From 8e98eb061706586fad3bccbcae5bcb5ee8722704 Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 12 Feb 2023 06:05:07 -0500 Subject: [PATCH] code refactoring (#1047) --- ct/adguard-v5.sh | 66 +++++++++++++++-------------- ct/alpine-v5.sh | 62 +++++++++++++--------------- ct/archlinux-v5.sh | 62 +++++++++++++--------------- ct/audiobookshelf-v5.sh | 58 +++++++++++++------------- ct/autobrr-v5.sh | 66 +++++++++++++++-------------- ct/blocky-v5.sh | 67 +++++++++++++++--------------- ct/casaos-v5.sh | 72 ++++++++++++++++---------------- ct/changedetection-v5.sh | 67 +++++++++++++++--------------- ct/cronicle-v5.sh | 63 +++++++++++++--------------- ct/daemonsync-v5.sh | 67 +++++++++++++++--------------- ct/dashy-v5.sh | 66 ++++++++++++++--------------- ct/debian-v5.sh | 58 +++++++++++++------------- ct/deconz-v5.sh | 67 +++++++++++++++--------------- ct/deluge-v5.sh | 65 +++++++++++++++-------------- ct/devuan-v5.sh | 58 +++++++++++++------------- ct/docker-v5.sh | 67 ++++++++++++++---------------- ct/emby-v5.sh | 66 ++++++++++++++--------------- ct/emqx-v5.sh | 62 +++++++++++++--------------- ct/esphome-v5.sh | 67 +++++++++++++++--------------- ct/grafana-v5.sh | 67 +++++++++++++++--------------- ct/grocy-v5.sh | 67 +++++++++++++++--------------- ct/heimdalldashboard-v5.sh | 67 +++++++++++++++--------------- ct/homeassistant-core-v5.sh | 65 +++++++++++++++-------------- ct/homeassistant-v5.sh | 73 ++++++++++++++++---------------- ct/homebridge-v5.sh | 67 +++++++++++++++--------------- ct/homepage-v5.sh | 67 +++++++++++++++--------------- ct/homer-v5.sh | 63 +++++++++++++++------------- ct/hyperion-v5.sh | 67 +++++++++++++++--------------- ct/influxdb-v5.sh | 67 +++++++++++++++--------------- ct/iobroker-v5.sh | 67 +++++++++++++++--------------- ct/jellyfin-v5.sh | 67 +++++++++++++++--------------- ct/k0s-v5.sh | 67 +++++++++++++++--------------- ct/kavita-v5.sh | 66 +++++++++++++++-------------- ct/keycloak-v5.sh | 67 +++++++++++++++--------------- ct/lidarr-v5.sh | 63 +++++++++++++++------------- ct/magicmirror-v5.sh | 67 +++++++++++++++--------------- ct/mariadb-v5.sh | 67 +++++++++++++++--------------- ct/meshcentral-v5.sh | 67 +++++++++++++++--------------- ct/motioneye-v5.sh | 67 +++++++++++++++--------------- ct/mqtt-v5.sh | 66 +++++++++++++++-------------- ct/n8n-v5.sh | 67 +++++++++++++++--------------- ct/navidrome-v5.sh | 66 ++++++++++++++--------------- ct/nextcloudpi-v5.sh | 67 +++++++++++++++--------------- ct/nginxproxymanager-v5.sh | 67 +++++++++++++++--------------- ct/nocodb-v5.sh | 68 +++++++++++++++--------------- ct/node-red-v5.sh | 66 ++++++++++++++--------------- ct/omada-v5.sh | 78 ++++++++++++++++++++--------------- ct/omv-v5.sh | 67 +++++++++++++++--------------- ct/openhab-v5.sh | 67 +++++++++++++++--------------- ct/paperless-ngx-v5.sh | 66 ++++++++++++++--------------- ct/photoprism-v5.sh | 68 +++++++++++++++--------------- ct/pihole-v5.sh | 67 +++++++++++++++--------------- ct/plex-v5.sh | 67 +++++++++++++++--------------- ct/podman-homeassistant-v5.sh | 66 ++++++++++++++--------------- ct/podman-v5.sh | 67 +++++++++++++++--------------- ct/postgresql-v5.sh | 67 +++++++++++++++--------------- ct/prometheus-v5.sh | 67 +++++++++++++++--------------- ct/prowlarr-v5.sh | 63 +++++++++++++++------------- ct/radarr-v5.sh | 63 +++++++++++++++------------- ct/readarr-v5.sh | 63 +++++++++++++++------------- ct/rockylinux-v5.sh | 72 ++++++++++++++++---------------- ct/sabnzbd-v5.sh | 63 +++++++++++++++------------- ct/scrypted-v5.sh | 67 +++++++++++++++--------------- ct/shinobi-v5.sh | 67 +++++++++++++++--------------- ct/sonarr-v5.sh | 63 +++++++++++++++------------- ct/syncthing-v5.sh | 67 +++++++++++++++--------------- ct/tdarr-v5.sh | 63 +++++++++++++++------------- ct/technitiumdns-v5.sh | 67 +++++++++++++++--------------- ct/transmission-v5.sh | 63 +++++++++++++++------------- ct/trilium-v5.sh | 67 +++++++++++++++--------------- ct/ubuntu-v5.sh | 58 +++++++++++++------------- ct/umbrel-v5.sh | 73 ++++++++++++++++---------------- ct/unifi-v5.sh | 67 +++++++++++++++--------------- ct/uptimekuma-v5.sh | 67 +++++++++++++++--------------- ct/vaultwarden-v5.sh | 65 +++++++++++++++-------------- ct/whisparr-v5.sh | 63 +++++++++++++++------------- ct/whoogle-v5.sh | 67 +++++++++++++++--------------- ct/wikijs-v5.sh | 67 +++++++++++++++--------------- ct/wireguard-v5.sh | 66 ++++++++++++++--------------- ct/yunohost-v5.sh | 63 +++++++++++++++------------- ct/zigbee2mqtt-v5.sh | 67 +++++++++++++++--------------- ct/zwave-js-ui-v5.sh | 67 +++++++++++++++--------------- 82 files changed, 2760 insertions(+), 2653 deletions(-) diff --git a/ct/adguard-v5.sh b/ct/adguard-v5.sh index 844fd239c..3ad5b01f7 100644 --- a/ct/adguard-v5.sh +++ b/ct/adguard-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,39 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /opt/AdGuardHome ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi + function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +307,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -366,7 +346,29 @@ msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/AdGuardHome ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/alpine-v5.sh b/ct/alpine-v5.sh index 01242e044..52f86ccac 100644 --- a/ct/alpine-v5.sh +++ b/ct/alpine-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,41 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/alpine-release ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -325,6 +302,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -345,7 +323,25 @@ apk upgrade &>/dev/null msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/archlinux-v5.sh b/ct/archlinux-v5.sh index f9154d57d..a979ffebd 100644 --- a/ct/archlinux-v5.sh +++ b/ct/archlinux-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /etc/pacman.d ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -349,7 +327,25 @@ pacman -Sy archlinux-keyring && pacman -Su msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/audiobookshelf-v5.sh b/ct/audiobookshelf-v5.sh index 51f3fbe56..903f34b02 100644 --- a/ct/audiobookshelf-v5.sh +++ b/ct/audiobookshelf-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,37 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}" CT_TYPE="0" @@ -324,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -344,7 +326,25 @@ apt-get -y upgrade &>/dev/null msg_ok "Updated $APP LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/autobrr-v5.sh b/ct/autobrr-v5.sh index 4f1ed7cd5..049e45855 100644 --- a/ct/autobrr-v5.sh +++ b/ct/autobrr-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,40 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /root/.config/autobrr ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -327,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -358,7 +337,30 @@ msg_ok "Started ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /root/.config/autobrr/config.toml ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/blocky-v5.sh b/ct/blocky-v5.sh index bc8697197..b88f4392b 100644 --- a/ct/blocky-v5.sh +++ b/ct/blocky-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /opt/blocky/ ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -349,7 +327,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/blocky ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/casaos-v5.sh b/ct/casaos-v5.sh index 8657add46..26f8fedb1 100644 --- a/ct/casaos-v5.sh +++ b/ct/casaos-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /etc/docker ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -140,7 +117,7 @@ function default_settings() { VLAN="" echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}" SSH="no" - echo -e "${DGN}(ZFS) Enable Fuse Overlayfs: ${BGN}No${CL}" + echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}No${CL}" FUSE="no" echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}" VERB="no" @@ -312,10 +289,10 @@ function advanced_settings() { SSH="no" fi if (whiptail --defaultno --title "FUSE OVERLAYFS" --yesno "(ZFS) Enable Fuse Overlayfs?" 10 58); then - echo -e "${DGN}(ZFS) Enable Fuse Overlayfs: ${BGN}Yes${CL}" + echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}Yes${CL}" FUSE="yes" else - echo -e "${DGN}(ZFS) Enable Fuse Overlayfs: ${BGN}No${CL}" + echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}No${CL}" FUSE="no" fi if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then @@ -337,6 +314,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -358,7 +336,29 @@ msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /etc/docker ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$FUSE" == "yes" ]; then FEATURES="fuse=1,keyctl=1,nesting=1" diff --git a/ct/changedetection-v5.sh b/ct/changedetection-v5.sh index 4df5b5b3b..bfc1b6d68 100644 --- a/ct/changedetection-v5.sh +++ b/ct/changedetection-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/systemd/system/changedetection.service ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -348,7 +326,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/changedetection.service ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/cronicle-v5.sh b/ct/cronicle-v5.sh index 7b1835c1f..614a20c41 100644 --- a/ct/cronicle-v5.sh +++ b/ct/cronicle-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,38 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} Master LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - SERVER="y" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} SUPPORT" --yesno "Options to Update or Install ${APP} Worker on $hostname. Proceed?" 10 58); then - echo "User selected Support" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -326,7 +306,9 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info +SERVER="y" if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info echo -e "${BL}Using Default Settings${CL}" @@ -356,10 +338,6 @@ msg_ok "Updated ${APP}" exit fi if [ "$UPD" == "2" ]; then - if [[ -d /opt/cronicle ]]; then - msg_error "${APP} Installation Found!"; - exit - fi LATEST=$(curl -sL https://api.github.com/repos/jhuckaby/Cronicle/releases/latest | grep '"tag_name":' | cut -d'"' -f4) IP=$(hostname -I | awk '{print $1}') msg_info "Installing Dependencies" @@ -395,7 +373,24 @@ exit fi } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/daemonsync-v5.sh b/ct/daemonsync-v5.sh index 339180a70..96b9b8fb0 100644 --- a/ct/daemonsync-v5.sh +++ b/ct/daemonsync-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /etc/daemonsync ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -349,7 +327,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /etc/daemonsync ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/dashy-v5.sh b/ct/dashy-v5.sh index 9449b137f..493fd3d1a 100644 --- a/ct/dashy-v5.sh +++ b/ct/dashy-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/systemd/system/dashy.service ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -375,7 +353,29 @@ msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/dashy.service ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/debian-v5.sh b/ct/debian-v5.sh index 8819bc736..c79f61fa0 100644 --- a/ct/debian-v5.sh +++ b/ct/debian-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,37 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -324,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -344,7 +326,25 @@ apt-get -y upgrade &>/dev/null msg_ok "Updated $APP LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/deconz-v5.sh b/ct/deconz-v5.sh index 0ba3f34f3..56b552598 100644 --- a/ct/deconz-v5.sh +++ b/ct/deconz-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/apt/sources.list.d/deconz.list ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}" echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}" @@ -329,6 +306,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -350,7 +328,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/deconz.list ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/deluge-v5.sh b/ct/deluge-v5.sh index 49f23d873..e8349ab1d 100644 --- a/ct/deluge-v5.sh +++ b/ct/deluge-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,37 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -325,6 +306,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -341,11 +323,34 @@ function update_script() { header_info msg_info "Updating $APP LXC" apt-get update &>/dev/null -apt-get -y upgrade &>/dev/null +pip3 install deluge[all] --upgrade msg_ok "Updated $APP LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/deluged.service ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/devuan-v5.sh b/ct/devuan-v5.sh index 65b4e0ea8..4f7d5ea04 100644 --- a/ct/devuan-v5.sh +++ b/ct/devuan-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,37 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -324,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -344,7 +326,25 @@ apt-get -y upgrade &>/dev/null msg_ok "Updated $APP LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/docker-v5.sh b/ct/docker-v5.sh index cc5e47975..0afd7a118 100644 --- a/ct/docker-v5.sh +++ b/ct/docker-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,39 +70,17 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /etc/docker ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Yes" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" @@ -139,7 +117,7 @@ function default_settings() { VLAN="" echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}" SSH="no" - echo -e "${DGN}(ZFS) Enable Fuse Overlayfs: ${BGN}No${CL}" + echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}No${CL}" FUSE="no" echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}" VERB="no" @@ -311,10 +289,10 @@ function advanced_settings() { SSH="no" fi if (whiptail --defaultno --title "FUSE OVERLAYFS" --yesno "(ZFS) Enable Fuse Overlayfs?" 10 58); then - echo -e "${DGN}(ZFS) Enable Fuse Overlayfs: ${BGN}Yes${CL}" + echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}Yes${CL}" FUSE="yes" else - echo -e "${DGN}(ZFS) Enable Fuse Overlayfs: ${BGN}No${CL}" + echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}No${CL}" FUSE="no" fi if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then @@ -336,6 +314,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -355,7 +334,25 @@ apt-get -y upgrade &>/dev/null msg_ok "Updated ${APP} LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$FUSE" == "yes" ]; then FEATURES="fuse=1,keyctl=1,nesting=1" diff --git a/ct/emby-v5.sh b/ct/emby-v5.sh index 1874ee85b..2859c1472 100644 --- a/ct/emby-v5.sh +++ b/ct/emby-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /opt/emby-server ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}" echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}" @@ -337,6 +314,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -368,7 +346,29 @@ msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/emby-server ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/emqx-v5.sh b/ct/emqx-v5.sh index 614b40455..01b760c99 100644 --- a/ct/emqx-v5.sh +++ b/ct/emqx-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/apt/sources.list.d/emqx_emqx.list ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -348,7 +326,25 @@ apt-get -y upgrade &>/dev/null msg_ok "Updated ${APP} LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/esphome-v5.sh b/ct/esphome-v5.sh index 91dbc0b5a..cd8cc028d 100644 --- a/ct/esphome-v5.sh +++ b/ct/esphome-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /usr/local/bin/esphome ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -355,7 +333,30 @@ msg_ok "Started ESPHome" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /usr/local/bin/esphome ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/grafana-v5.sh b/ct/grafana-v5.sh index 2662a04db..fa798d4a3 100644 --- a/ct/grafana-v5.sh +++ b/ct/grafana-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/apt/sources.list.d/grafana.list ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -349,7 +327,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/grafana.list ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/grocy-v5.sh b/ct/grocy-v5.sh index 9563990b8..c49d1c5ad 100644 --- a/ct/grocy-v5.sh +++ b/ct/grocy-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/apache2/sites-available/grocy.conf ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -348,7 +326,30 @@ msg_ok "Updated ${APP}" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apache2/sites-available/grocy.conf ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/heimdalldashboard-v5.sh b/ct/heimdalldashboard-v5.sh index 6596aa0bf..bca0c925b 100644 --- a/ct/heimdalldashboard-v5.sh +++ b/ct/heimdalldashboard-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /opt/Heimdall ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -428,7 +406,30 @@ msg_ok "Started ${APP}" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/Heimdall ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/homeassistant-core-v5.sh b/ct/homeassistant-core-v5.sh index e3ada4d10..828d9424e 100644 --- a/ct/homeassistant-core-v5.sh +++ b/ct/homeassistant-core-v5.sh @@ -62,8 +62,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -72,39 +72,17 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /srv/homeassistant ]]; then - msg_error "No Home Assistant Core Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC SUPPORT" --yesno "This provides Support for ${APP} LXC" 10 58); then - echo "User selected Support" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" @@ -331,6 +309,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -423,7 +402,29 @@ exit fi } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /srv/homeassistant ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/homeassistant-v5.sh b/ct/homeassistant-v5.sh index ee46dbe81..010dcf7a0 100644 --- a/ct/homeassistant-v5.sh +++ b/ct/homeassistant-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,41 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /root/hass_config ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC SUPPORT" --yesno "This provides Support for ${APP} LXC. Proceed?" 10 58); then - echo "User selected support" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -141,7 +118,7 @@ function default_settings() { VLAN="" echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}" SSH="no" - echo -e "${DGN}(ZFS) Enable Fuse Overlayfs: ${BGN}No${CL}" + echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}No${CL}" FUSE="no" echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}" VERB="no" @@ -314,10 +291,10 @@ function advanced_settings() { SSH="no" fi if (whiptail --defaultno --title "FUSE OVERLAYFS" --yesno "(ZFS) Enable Fuse Overlayfs?" 10 58); then - echo -e "${DGN}(ZFS) Enable Fuse Overlayfs: ${BGN}Yes${CL}" + echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}Yes${CL}" FUSE="yes" else - echo -e "${DGN}(ZFS) Enable Fuse Overlayfs: ${BGN}No${CL}" + echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}No${CL}" FUSE="no" fi if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then @@ -339,6 +316,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -423,7 +401,30 @@ exit fi } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /var/lib/docker/volumes/hass_config/_data + ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$FUSE" == "yes" ]; then FEATURES="fuse=1,keyctl=1,nesting=1" diff --git a/ct/homebridge-v5.sh b/ct/homebridge-v5.sh index 806346490..8fda38e71 100644 --- a/ct/homebridge-v5.sh +++ b/ct/homebridge-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/apt/sources.list.d/emqx_emqx.list ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -349,7 +327,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/homebridge.service ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/homepage-v5.sh b/ct/homepage-v5.sh index fae8323e2..4246a5f3d 100644 --- a/ct/homepage-v5.sh +++ b/ct/homepage-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/systemd/system/homepage.service ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -355,7 +333,30 @@ systemctl start homepage msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/homepage.service ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/homer-v5.sh b/ct/homer-v5.sh index 36c823ef2..c18bd3772 100644 --- a/ct/homer-v5.sh +++ b/ct/homer-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,37 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -324,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -368,7 +350,30 @@ msg_ok "Started ${APP}" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/homer ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/hyperion-v5.sh b/ct/hyperion-v5.sh index 29c990c58..92cdc5449 100644 --- a/ct/hyperion-v5.sh +++ b/ct/hyperion-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/apt/sources.list.d/hyperion.list ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}" CT_TYPE="0" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -349,7 +327,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/hyperion.list ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/influxdb-v5.sh b/ct/influxdb-v5.sh index ec9f8b242..d7b62cd42 100644 --- a/ct/influxdb-v5.sh +++ b/ct/influxdb-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/apt/sources.list.d/influxdb.list ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -349,7 +327,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/influxdb.list ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/iobroker-v5.sh b/ct/iobroker-v5.sh index 9e37fd2b7..d657eeeae 100644 --- a/ct/iobroker-v5.sh +++ b/ct/iobroker-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /opt/iobroker ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -349,7 +327,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/iobroker ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/jellyfin-v5.sh b/ct/jellyfin-v5.sh index 519151872..d0a8cf82c 100644 --- a/ct/jellyfin-v5.sh +++ b/ct/jellyfin-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,41 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /usr/lib/jellyfin ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}" @@ -339,6 +316,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -358,7 +336,30 @@ apt-get -y upgrade &>/dev/null msg_ok "Updated ${APP} LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /usr/lib/jellyfin ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/k0s-v5.sh b/ct/k0s-v5.sh index e91106f24..143292ca7 100644 --- a/ct/k0s-v5.sh +++ b/ct/k0s-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/k0s/k0s.yaml ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -349,7 +327,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/k0s/k0s.yaml ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/kavita-v5.sh b/ct/kavita-v5.sh index 94bd161dd..77e3889ab 100644 --- a/ct/kavita-v5.sh +++ b/ct/kavita-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,40 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /opt/Kavita ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -327,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -347,7 +326,30 @@ apt-get -y upgrade &>/dev/null msg_ok "Updated $APP LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/Kavita ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/keycloak-v5.sh b/ct/keycloak-v5.sh index b106d2c9f..11f0d9ea1 100644 --- a/ct/keycloak-v5.sh +++ b/ct/keycloak-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,41 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/systemd/system/keycloak.service ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -329,6 +306,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -350,7 +328,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/keycloak.service ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/lidarr-v5.sh b/ct/lidarr-v5.sh index fe6acc9af..e4877512d 100644 --- a/ct/lidarr-v5.sh +++ b/ct/lidarr-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,37 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -324,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -344,7 +326,30 @@ apt-get -y upgrade &>/dev/null msg_ok "Updated $APP LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /var/lib/lidarr/ ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/magicmirror-v5.sh b/ct/magicmirror-v5.sh index c6802492f..5f8b8704d 100644 --- a/ct/magicmirror-v5.sh +++ b/ct/magicmirror-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,41 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /opt/magicmirror ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -329,6 +306,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -351,7 +329,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/magicmirror ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/mariadb-v5.sh b/ct/mariadb-v5.sh index e56b6b44b..7705a589e 100644 --- a/ct/mariadb-v5.sh +++ b/ct/mariadb-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/apt/sources.list.d/mariadb.list ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -349,7 +327,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/mariadb.list ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/meshcentral-v5.sh b/ct/meshcentral-v5.sh index 1b16dc68b..c34c57094 100644 --- a/ct/meshcentral-v5.sh +++ b/ct/meshcentral-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /opt/meshcentral ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -349,7 +327,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/meshcentral ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/motioneye-v5.sh b/ct/motioneye-v5.sh index 0017ab4d0..78a5ff8b2 100644 --- a/ct/motioneye-v5.sh +++ b/ct/motioneye-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/systemd/system/motioneye.service ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -348,7 +326,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/motioneye.service ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/mqtt-v5.sh b/ct/mqtt-v5.sh index efe46dedf..831ea2189 100644 --- a/ct/mqtt-v5.sh +++ b/ct/mqtt-v5.sh @@ -59,8 +59,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -69,39 +69,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/apt/sources.list.d/mosquitto-bullseye.list ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi + function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -326,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -348,7 +328,29 @@ msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/mosquitto-bullseye.list ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/n8n-v5.sh b/ct/n8n-v5.sh index c6828567f..4e9ffc1ed 100644 --- a/ct/n8n-v5.sh +++ b/ct/n8n-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,41 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/systemd/system/n8n.service ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -329,6 +306,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -349,7 +327,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/n8n.service ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/navidrome-v5.sh b/ct/navidrome-v5.sh index bc6db67bc..8ad6a7d0a 100644 --- a/ct/navidrome-v5.sh +++ b/ct/navidrome-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /opt/navidrome ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -360,7 +338,29 @@ msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/navidrome ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/nextcloudpi-v5.sh b/ct/nextcloudpi-v5.sh index 2afbaa121..2832dfd53 100644 --- a/ct/nextcloudpi-v5.sh +++ b/ct/nextcloudpi-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /lib/systemd/system/nextcloud-domain.service ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}" CT_TYPE="0" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -349,7 +327,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /lib/systemd/system/nextcloud-domain.service ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/nginxproxymanager-v5.sh b/ct/nginxproxymanager-v5.sh index aa9ca1a9d..35e7df35c 100644 --- a/ct/nginxproxymanager-v5.sh +++ b/ct/nginxproxymanager-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,41 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /lib/systemd/system/npm.service ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -329,6 +306,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -458,7 +436,30 @@ msg_ok "Cleaned" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /lib/systemd/system/npm.service ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/nocodb-v5.sh b/ct/nocodb-v5.sh index 929112bd0..7bce9820e 100644 --- a/ct/nocodb-v5.sh +++ b/ct/nocodb-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/systemd/system/nocodb.service ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -349,10 +327,32 @@ npm install -s --save nocodb &>/dev/null systemctl restart nocodb.service msg_ok "Updated ${APP}" msg_ok "Update Successfull" - exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/nocodb.service ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/node-red-v5.sh b/ct/node-red-v5.sh index f5f1fba16..934d59a3a 100644 --- a/ct/node-red-v5.sh +++ b/ct/node-red-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /root/.node-red ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC SUPPORT" --yesno "This provides Support for ${APP} LXC. Proceed?" 10 58); then - echo "User selected support" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -384,7 +362,29 @@ exit fi } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /root/.node-red ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/omada-v5.sh b/ct/omada-v5.sh index ae6ad8a5f..72f16b52a 100644 --- a/ct/omada-v5.sh +++ b/ct/omada-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /opt/tplink ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}" echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" @@ -337,6 +314,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -347,8 +325,42 @@ header_info echo -e "${RD}Using Advanced Settings${CL}" advanced_settings fi + exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +function update_script() { +header_info +msg_info "Updating ${APP} LXC" +apt-get update &>/dev/null +apt-get -y upgrade &>/dev/null +msg_ok "Updated ${APP} LXC" +msg_ok "Update Successfull" +exit +} + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/tplink ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/omv-v5.sh b/ct/omv-v5.sh index 13b0bb86f..544f073cd 100644 --- a/ct/omv-v5.sh +++ b/ct/omv-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,41 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/apt/sources.list.d/openmediavault.list ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}" CT_TYPE="0" @@ -329,6 +306,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -350,7 +328,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/openmediavault.list ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/openhab-v5.sh b/ct/openhab-v5.sh index bb41242fb..74d31c860 100644 --- a/ct/openhab-v5.sh +++ b/ct/openhab-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,41 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/apt/sources.list.d/openhab.list ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -329,6 +306,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -350,7 +328,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/openhab.list ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/paperless-ngx-v5.sh b/ct/paperless-ngx-v5.sh index fa7444420..e11ba30b1 100644 --- a/ct/paperless-ngx-v5.sh +++ b/ct/paperless-ngx-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,41 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /opt/paperless ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC SUPPORT" --yesno "This provides Support for ${APP} LXC. Proceed?" 10 58); then - echo "User selected support" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -329,6 +306,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -417,7 +395,29 @@ exit fi } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/paperless ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/photoprism-v5.sh b/ct/photoprism-v5.sh index 4953243d3..ecc2399f8 100644 --- a/ct/photoprism-v5.sh +++ b/ct/photoprism-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,40 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi -} - -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /opt/photoprism ]]; then - msg_error "No PhotoPrism Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Yes" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi +} + function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -327,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -370,7 +349,30 @@ msg_ok "Started PhotoPrism" msg_ok "Update Successful" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/photoprism ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/pihole-v5.sh b/ct/pihole-v5.sh index b2b7db58a..d22efe088 100644 --- a/ct/pihole-v5.sh +++ b/ct/pihole-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /etc/pihole ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -349,7 +327,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /etc/pihole ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/plex-v5.sh b/ct/plex-v5.sh index e71889385..5f0cae8a1 100644 --- a/ct/plex-v5.sh +++ b/ct/plex-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/apt/sources.list.d/plexmediaserver.list ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}" @@ -338,6 +315,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -368,7 +346,30 @@ bash -c "$(wget -qO - https://raw.githubusercontent.com/mrworf/plexupdate/master exit fi } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/plexmediaserver.list ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/podman-homeassistant-v5.sh b/ct/podman-homeassistant-v5.sh index c1ba384fb..e03bca6ac 100644 --- a/ct/podman-homeassistant-v5.sh +++ b/ct/podman-homeassistant-v5.sh @@ -64,8 +64,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -74,41 +74,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/systemd/system/homeassistant.service ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -332,6 +309,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -400,7 +378,29 @@ exit fi } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/homeassistant.service ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/podman-v5.sh b/ct/podman-v5.sh index 0fa602e5f..93d108b93 100644 --- a/ct/podman-v5.sh +++ b/ct/podman-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/containers/registries.conf ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -349,7 +327,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/containers/registries.conf ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/postgresql-v5.sh b/ct/postgresql-v5.sh index a8f24dedd..3c052a86b 100644 --- a/ct/postgresql-v5.sh +++ b/ct/postgresql-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/apt/sources.list.d/pgdg.list ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -349,7 +327,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/pgdg.list ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/prometheus-v5.sh b/ct/prometheus-v5.sh index 8d6b444f7..bf6a2cf67 100644 --- a/ct/prometheus-v5.sh +++ b/ct/prometheus-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/systemd/system/prometheus.service ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -349,7 +327,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/prometheus.service ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/prowlarr-v5.sh b/ct/prowlarr-v5.sh index dec41aee3..d7ffa7559 100644 --- a/ct/prowlarr-v5.sh +++ b/ct/prowlarr-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,37 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -324,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -344,7 +326,30 @@ apt-get -y upgrade &>/dev/null msg_ok "Updated $APP LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /var/lib/prowlarr/ ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/radarr-v5.sh b/ct/radarr-v5.sh index 70f6d794e..815cc4fd9 100644 --- a/ct/radarr-v5.sh +++ b/ct/radarr-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,37 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -324,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -344,7 +326,30 @@ apt-get -y upgrade &>/dev/null msg_ok "Updated $APP LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /var/lib/radarr/ ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/readarr-v5.sh b/ct/readarr-v5.sh index e79a0e141..769e10203 100644 --- a/ct/readarr-v5.sh +++ b/ct/readarr-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,37 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -324,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -344,7 +326,30 @@ apt-get -y upgrade &>/dev/null msg_ok "Updated $APP LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /var/lib/readarr/ ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/rockylinux-v5.sh b/ct/rockylinux-v5.sh index 56403ea1e..ea9c95500 100644 --- a/ct/rockylinux-v5.sh +++ b/ct/rockylinux-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,41 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /etc/pacman.d ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -329,6 +306,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -344,13 +322,35 @@ header_info function update_script() { header_info msg_info "Updating ${APP} LXC" -pacman-key --init -pacman-key --populate archlinux -pacman -Sy archlinux-keyring && pacman -Su +dnf -y update +dnf -y upgrade msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /etc/pacman.d ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/sabnzbd-v5.sh b/ct/sabnzbd-v5.sh index d34674cab..e923ad365 100644 --- a/ct/sabnzbd-v5.sh +++ b/ct/sabnzbd-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,37 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -324,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -344,7 +326,30 @@ apt-get -y upgrade &>/dev/null msg_ok "Updated $APP LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/sabnzbd ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/scrypted-v5.sh b/ct/scrypted-v5.sh index acf113731..6b90147f4 100644 --- a/ct/scrypted-v5.sh +++ b/ct/scrypted-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,41 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/systemd/system/scrypted.service ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -329,6 +306,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -350,7 +328,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/scrypted.service ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/shinobi-v5.sh b/ct/shinobi-v5.sh index 08aca23c4..14b4850c9 100644 --- a/ct/shinobi-v5.sh +++ b/ct/shinobi-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /opt/Shinobi ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}" echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" @@ -337,6 +314,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -359,7 +337,30 @@ pm2 restart cron msg_ok "Updated Shinobi LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/Shinobi ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/sonarr-v5.sh b/ct/sonarr-v5.sh index 47397bdd9..d948ab5bb 100644 --- a/ct/sonarr-v5.sh +++ b/ct/sonarr-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,37 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -324,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -344,7 +326,30 @@ apt-get -y upgrade &>/dev/null msg_ok "Updated $APP LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/sonarr.list ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/syncthing-v5.sh b/ct/syncthing-v5.sh index e6ad0979e..2b0e83a75 100644 --- a/ct/syncthing-v5.sh +++ b/ct/syncthing-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,41 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/apt/sources.list.d/syncthing.list ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -329,6 +306,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -350,7 +328,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/sources.list.d/syncthing.list ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/tdarr-v5.sh b/ct/tdarr-v5.sh index d078ef544..5813b5a6a 100644 --- a/ct/tdarr-v5.sh +++ b/ct/tdarr-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,37 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -324,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -344,7 +326,30 @@ apt-get -y upgrade &>/dev/null msg_ok "Updated $APP LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/tdarr ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/technitiumdns-v5.sh b/ct/technitiumdns-v5.sh index 374a8b327..099d6b657 100644 --- a/ct/technitiumdns-v5.sh +++ b/ct/technitiumdns-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /etc/dns ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -411,7 +389,30 @@ fi msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /etc/dns ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/transmission-v5.sh b/ct/transmission-v5.sh index 1e823bd09..0ee5d0687 100644 --- a/ct/transmission-v5.sh +++ b/ct/transmission-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,37 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -324,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -344,7 +326,30 @@ apt-get -y upgrade &>/dev/null msg_ok "Updated ${APP} LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/transmission-daemon/settings.json ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/trilium-v5.sh b/ct/trilium-v5.sh index 1a8818ffb..3ac54cb04 100644 --- a/ct/trilium-v5.sh +++ b/ct/trilium-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /opt/trilium/ ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -368,7 +346,30 @@ msg_ok "Started ${APP}" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d ! -d /opt/trilium ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/ubuntu-v5.sh b/ct/ubuntu-v5.sh index 4c8eeff39..f283066b1 100644 --- a/ct/ubuntu-v5.sh +++ b/ct/ubuntu-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,37 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using ${var_os} Version: ${BGN}${var_version}${CL}" echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" @@ -333,6 +314,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -352,7 +334,25 @@ apt-get -y upgrade &>/dev/null msg_ok "Updated ${APP} LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/umbrel-v5.sh b/ct/umbrel-v5.sh index a0964a32f..e70695d12 100644 --- a/ct/umbrel-v5.sh +++ b/ct/umbrel-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /root/umbrel ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -140,7 +117,7 @@ function default_settings() { VLAN="" echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}" SSH="no" - echo -e "${DGN}(ZFS) Enable Fuse Overlayfs: ${BGN}No${CL}" + echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}No${CL}" FUSE="no" echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}" VERB="no" @@ -312,10 +289,10 @@ function advanced_settings() { SSH="no" fi if (whiptail --defaultno --title "FUSE OVERLAYFS" --yesno "(ZFS) Enable Fuse Overlayfs?" 10 58); then - echo -e "${DGN}(ZFS) Enable Fuse Overlayfs: ${BGN}Yes${CL}" + echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}Yes${CL}" FUSE="yes" else - echo -e "${DGN}(ZFS) Enable Fuse Overlayfs: ${BGN}No${CL}" + echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}No${CL}" FUSE="no" fi if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then @@ -337,6 +314,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -356,7 +334,30 @@ apt-get -y upgrade &>/dev/null msg_ok "Updated ${APP} LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /root/umbrel ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$FUSE" == "yes" ]; then FEATURES="fuse=1,keyctl=1,nesting=1" diff --git a/ct/unifi-v5.sh b/ct/unifi-v5.sh index 08fc5a772..2e2bce79c 100644 --- a/ct/unifi-v5.sh +++ b/ct/unifi-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /usr/lib/unifi ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -349,7 +327,30 @@ msg_ok "Updated ${APP}" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /usr/lib/unifi ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/uptimekuma-v5.sh b/ct/uptimekuma-v5.sh index fc2b2662c..a7d24e829 100644 --- a/ct/uptimekuma-v5.sh +++ b/ct/uptimekuma-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,41 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /opt/uptime-kuma ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -329,6 +306,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -366,7 +344,30 @@ msg_ok "Started ${APP}" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/uptime-kuma ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/vaultwarden-v5.sh b/ct/vaultwarden-v5.sh index e08c9440c..d3fd4f293 100644 --- a/ct/vaultwarden-v5.sh +++ b/ct/vaultwarden-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,39 +70,17 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /etc/systemd/system/vaultwarden.service ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC SUPPORT" --yesno "This provides Support for ${APP} LXC. Proceed?" 10 58); then - echo "User selected support" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" @@ -328,6 +306,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -417,7 +396,29 @@ exit fi } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/systemd/system/vaultwarden.service ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/whisparr-v5.sh b/ct/whisparr-v5.sh index 64b76ebfd..7a3beee55 100644 --- a/ct/whisparr-v5.sh +++ b/ct/whisparr-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,37 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -325,6 +306,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -345,7 +327,30 @@ apt-get -y upgrade &>/dev/null msg_ok "Updated $APP LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /var/lib/whisparr ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/whoogle-v5.sh b/ct/whoogle-v5.sh index a5e65954d..6d4d9093b 100644 --- a/ct/whoogle-v5.sh +++ b/ct/whoogle-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -f /usr/local/bin/whoogle-search ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -348,7 +326,30 @@ msg_ok "Updated ${APP} LXC" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /usr/local/bin/whoogle-search ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/wikijs-v5.sh b/ct/wikijs-v5.sh index b69e504cb..6091efafe 100644 --- a/ct/wikijs-v5.sh +++ b/ct/wikijs-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,41 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /opt/wikijs ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -329,6 +306,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -362,7 +340,30 @@ msg_ok "Started ${APP}" msg_ok "Update Successfull" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/wikijs ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/wireguard-v5.sh b/ct/wireguard-v5.sh index c18bf9f64..8bac4026b 100644 --- a/ct/wireguard-v5.sh +++ b/ct/wireguard-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /etc/pivpn/wireguard ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC SUPPORT" --yesno "This provides Support for ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -404,7 +382,29 @@ exit fi } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /etc/pivpn/wireguard ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/yunohost-v5.sh b/ct/yunohost-v5.sh index bc234a6c4..c5b72d489 100644 --- a/ct/yunohost-v5.sh +++ b/ct/yunohost-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,37 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Unprivileged${CL} ${RD}NO DEVICE PASSTHROUGH${CL}" CT_TYPE="1" @@ -324,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -344,7 +326,30 @@ apt-get -y upgrade &>/dev/null msg_ok "Updated $APP LXC" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /etc/apt/trusted.gpg.d/php.gpg ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/zigbee2mqtt-v5.sh b/ct/zigbee2mqtt-v5.sh index 71465d159..fc238d95e 100644 --- a/ct/zigbee2mqtt-v5.sh +++ b/ct/zigbee2mqtt-v5.sh @@ -61,8 +61,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -71,41 +71,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /opt/zigbee2mqtt ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}" CT_TYPE="0" @@ -329,6 +306,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -395,7 +373,30 @@ start_zigbee2mqtt echo "Done!" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/zigbee2mqtt ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1" diff --git a/ct/zwave-js-ui-v5.sh b/ct/zwave-js-ui-v5.sh index 1e4dd191e..a56356b4f 100644 --- a/ct/zwave-js-ui-v5.sh +++ b/ct/zwave-js-ui-v5.sh @@ -60,8 +60,8 @@ function msg_ok() { } function msg_error() { - local msg="$1" - echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" + local msg="$1" + echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } function PVE_CHECK() { @@ -70,41 +70,18 @@ if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then echo -e "Requires PVE Version 7.0 or higher" echo -e "Exiting..." sleep 2 - exit +exit fi } function ARCH_CHECK() { - if [ "$(dpkg --print-architecture)" != "amd64" ]; then - echo -e "\n ${CROSS} This script will not work with PiMox! \n" - echo -e "Exiting..." - sleep 2 - exit - fi +if [ "$(dpkg --print-architecture)" != "amd64" ]; then + echo -e "\n ${CROSS} This script will not work with PiMox! \n" + echo -e "Exiting..." + sleep 2 +exit +fi } -if command -v pveversion >/dev/null 2>&1; then - if (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then - NEXTID=$(pvesh get /cluster/nextid) - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi -if ! command -v pveversion >/dev/null 2>&1; then - if [[ ! -d /opt/zwave-js-ui ]]; then - msg_error "No ${APP} Installation Found!"; - exit - fi - if (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then - echo "User selected Update" - else - clear - echo -e "⚠ User exited script \n" - exit - fi -fi - function default_settings() { echo -e "${DGN}Using Container Type: ${BGN}Privileged${CL}" CT_TYPE="0" @@ -328,6 +305,7 @@ function advanced_settings() { function install_script() { ARCH_CHECK PVE_CHECK +NEXTID=$(pvesh get /cluster/nextid) header_info if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then header_info @@ -362,7 +340,30 @@ msg_ok "Cleaned" msg_ok "Updated Successfully!\n" exit } -if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi + +if command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + install_script +fi + +if ! command -v pveversion >/dev/null 2>&1 && [[ ! -d /opt/zwave-js-ui ]]; then + msg_error "No ${APP} Installation Found!" + exit +fi + +if ! command -v pveversion >/dev/null 2>&1; then + if ! (whiptail --title "${APP} LXC UPDATE" --yesno "This will update ${APP} LXC. Proceed?" 10 58); then + clear + echo -e "⚠ User exited script \n" + exit + fi + update_script +fi + if [ "$VERB" == "yes" ]; then set -x; fi if [ "$CT_TYPE" == "1" ]; then FEATURES="nesting=1,keyctl=1"