From c586262d48e990050c4ad6ec649c54469a776458 Mon Sep 17 00:00:00 2001 From: ben Date: Sun, 3 Sep 2023 07:31:25 +0000 Subject: [PATCH] Update 'root/usr/libexec/apps/alltube/alltube.sh' --- root/usr/libexec/apps/alltube/alltube.sh | 72 ++++++++++++------------ 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/root/usr/libexec/apps/alltube/alltube.sh b/root/usr/libexec/apps/alltube/alltube.sh index 2eba52a..6f57305 100644 --- a/root/usr/libexec/apps/alltube/alltube.sh +++ b/root/usr/libexec/apps/alltube/alltube.sh @@ -4,18 +4,17 @@ ACTION=${1} shift 1 get_image() { - IMAGE_NAME="rudloff/alltube" + IMAGE_NAME=$(uci get alltube.@alltube[0].image_name 2>/dev/null) } do_install_detail() { - local config=`uci get alltube.@alltube[0].config_path 2>/dev/null` - local port=`uci get alltube.@alltube[0].port 2>/dev/null` - local IMAGE_NAME=`uci get alltube.@alltube[0].image_name 2>/dev/null` - local username=`uci get alltube.@alltube[0].username 2>/dev/null` - local password=`uci get alltube.@alltube[0].password 2>/dev/null` - - #Generate the generic environment variables for the docker-compose + local config=$(uci get alltube.@alltube[0].config_path 2>/dev/null) + local port=$(uci get alltube.@alltube[0].port 2>/dev/null) + local IMAGE_NAME=$(uci get alltube.@alltube[0].image_name 2>/dev/null) + local username=$(uci get alltube.@alltube[0].username 2>/dev/null) + local password=$(uci get alltube.@alltube[0].password 2>/dev/null) + # Generate random passwords similar to Searxng script 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) @@ -23,44 +22,37 @@ do_install_detail() { 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 - fi + [ -z "$config" ] && echo "config path is empty!" && exit 1 [ -z "$port" ] && port=5993 [ -z "$IMAGE_NAME" ] && IMAGE_NAME=rudloff/alltube - - # Create Docker Compose file with custom variables - # Create Docker Compose file with custom variables -touch docker-compose.yml -cat > docker-compose.yml < /opt/docker2/compose/alltube-app/docker-compose.yml <