Compare commits

..

5 Commits

Author SHA1 Message Date
tteckster 4eab2fed42
Update gotify-install.sh
tweak
2024-01-01 11:49:31 -05:00
tteckster 0d288a2e66
Update gotify-install.sh
create directory
2024-01-01 11:42:03 -05:00
tteckster 96b0a6d172
Create gotify.sh 2024-01-01 11:37:43 -05:00
tteckster 0dd9401ed7
Create gotify-install.sh 2024-01-01 11:35:26 -05:00
tteckster 497d629fdc
Update zigbee2mqtt.sh
(node 18.x has stopped utilizing npm by default)

- check if the installed version of Node.js is 18.x and, if so, ensures that npm is also installed.
- fixes https://github.com/tteck/Proxmox/issues/2281
2024-01-01 11:08:24 -05:00
3 changed files with 130 additions and 0 deletions

66
ct/gotify.sh Normal file
View File

@ -0,0 +1,66 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func)
# Copyright (c) 2021-2023 tteck
# Author: tteck (tteckster)
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
function header_info {
clear
cat <<"EOF"
______ __ _ ____
/ ____/___ / /_(_) __/_ __
/ / __/ __ \/ __/ / /_/ / / /
/ /_/ / /_/ / /_/ / __/ /_/ /
\____/\____/\__/_/_/ \__, /
/____/
EOF
}
header_info
echo -e "Loading..."
APP="Gotify"
var_disk="2"
var_cpu="1"
var_ram="512"
var_os="debian"
var_version="12"
variables
color
catch_errors
function default_settings() {
CT_TYPE="1"
PW=""
CT_ID=$NEXTID
HN=$NSAPP
DISK_SIZE="$var_disk"
CORE_COUNT="$var_cpu"
RAM_SIZE="$var_ram"
BRG="vmbr0"
NET="dhcp"
GATE=""
DISABLEIP6="no"
MTU=""
SD=""
NS=""
MAC=""
VLAN=""
SSH="no"
VERB="no"
echo_default
}
function update_script() {
header_info
if [[ ! -d /opt/gotify ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
msg_error "There is currently no update path available."
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP} ${CL} \n"

View File

@ -57,6 +57,13 @@ function update_script() {
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
if [[ "$(node -v | cut -d 'v' -f 2)" == "18."* ]]; then
if ! command -v npm >/dev/null 2>&1; then
echo "Installing NPM..."
apt-get install -y npm >/dev/null 2>&1
echo "Installed NPM..."
fi
fi
cd /opt/zigbee2mqtt cd /opt/zigbee2mqtt
stop_zigbee2mqtt() { stop_zigbee2mqtt() {

57
install/gotify-install.sh Normal file
View File

@ -0,0 +1,57 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2024 tteck
# Author: tteck (tteckster)
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt-get install -y curl
$STD apt-get install -y sudo
$STD apt-get install -y mc
msg_ok "Installed Dependencies"
msg_info "Installing Gotify"
RELEASE=$(curl -s https://api.github.com/repos/gotify/server/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
mkdir -p /opt/gotify
cd /opt/gotify
wget -q https://github.com/gotify/server/releases/download/v${RELEASE}/gotify-linux-amd64.zip
$STD unzip gotify-linux-amd64.zip
rm -rf gotify-linux-amd64.zip
chmod +x gotify-linux-amd64
cat <<EOF >/etc/systemd/system/gotify.service
[Unit]
Description=Gotify
Requires=network.target
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/gotify
ExecStart=/opt/gotify/./gotify-linux-amd64
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now gotify
msg_ok "Installed Gotify"
motd_ssh
customize
msg_info "Cleaning up"
$STD apt-get autoremove
$STD apt-get autoclean
msg_ok "Cleaned"