From 5ce787688d9377ece701a6411f0f627ab3c01821 Mon Sep 17 00:00:00 2001 From: ben Date: Thu, 7 Sep 2023 01:59:52 +0000 Subject: [PATCH] Update 'root/usr/libexec/apps/gotify/gotify.sh' --- root/usr/libexec/apps/gotify/gotify.sh | 90 ++++++++++++-------------- 1 file changed, 43 insertions(+), 47 deletions(-) diff --git a/root/usr/libexec/apps/gotify/gotify.sh b/root/usr/libexec/apps/gotify/gotify.sh index 16decf2..a2d684f 100755 --- a/root/usr/libexec/apps/gotify/gotify.sh +++ b/root/usr/libexec/apps/gotify/gotify.sh @@ -4,68 +4,52 @@ ACTION=${1} shift 1 get_image() { - IMAGE_NAME="gotify/server" + IMAGE_NAME=$(uci get gotify.@gotify[0].image_name 2>/dev/null) } do_install_detail() { - local config=`uci get gotify.@gotify[0].config_path 2>/dev/null` - local port=`uci get gotify.@gotify[0].port 2>/dev/null` - local IMAGE_NAME=`uci get gotify.@gotify[0].image_name 2>/dev/null` - local username=`uci get gotify.@gotify[0].username 2>/dev/null` - local password=`uci get gotify.@gotify[0].password 2>/dev/null` + local config=$(uci get gotify.@gotify[0].config_path 2>/dev/null) + local port=$(uci get gotify.@gotify[0].port 2>/dev/null) + local IMAGE_NAME=$(uci get gotify.@gotify[0].image_name 2>/dev/null) + local username=$(uci get gotify.@gotify[0].username 2>/dev/null) + local password=$(uci get gotify.@gotify[0].password 2>/dev/null) - #Generate the generic environment variables for the docker-compose - - GEN_PASS=$(< /dev/urandom tr -dc A-Za-z0-9 2>/dev/null | head -c14; echo) - GEN_PASS2=$(< /dev/urandom tr -dc A-Za-z0-9 2>/dev/null | head -c14; echo) - - # Get our local LAN IP Address LAN_IP=$(uci get network.lan.ipaddr) - # Strip trailing network mask LAN_IP="${LAN_IP%/*}" - + if [ -z "$config" ]; then - echo "config path is empty!" - exit 1 + echo "config path is empty!" + exit 1 fi [ -z "$port" ] && port=8050 [ -z "$IMAGE_NAME" ] && IMAGE_NAME=gotify/server - - # Create Docker Compose file with custom variables - - # Create Docker Compose file with custom variables -cat > docker-compose.yml < /opt/docker2/compose/gotify-app/docker-compose.yml <