#!/bin/sh ACTION=${1} shift 1 get_image() { IMAGE_NAME="latest" } do_install_detail() { local config=`uci get webtop.@webtop[0].config_path 2>/dev/null` local port=`uci get webtop.@webtop[0].port 2>/dev/null` local IMAGE_NAME=`uci get webtop.@webtop[0].image_name 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 fi [ -z "$port" ] && port=3000 [ -z "$IMAGE_NAME" ] && IMAGE_NAME=latest # Create Docker Compose file with custom variables rm -R /opt/docker2/compose/webtop mkdir /opt/docker2/compose/webtop # Create Docker Compose file with custom variables touch /opt/docker2/compose/webtop/docker-compose.yml cat > /opt/docker2/compose/webtop/docker-compose.yml <