From aca555c06863da0d2caa1c47b7d71e43f6bcdbf3 Mon Sep 17 00:00:00 2001 From: tremor021 Date: Wed, 7 Jan 2026 19:23:25 +0100 Subject: [PATCH] add GWN Manager script --- ct/gwn-manager.sh | 42 +++++++++++++++++++++++++++ install/gwn-manager-install.sh | 52 ++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 ct/gwn-manager.sh create mode 100644 install/gwn-manager-install.sh diff --git a/ct/gwn-manager.sh b/ct/gwn-manager.sh new file mode 100644 index 000000000..73d0938b8 --- /dev/null +++ b/ct/gwn-manager.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2026 community-scripts ORG +# Author: Slaviša Arežina (tremor021) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://www.grandstream.com/products/networking-solutions/wi-fi-management/product/gwn-manager + +APP="GWN Manager" +var_tags="${var_tags:-network;management}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-6144}" +var_disk="${var_disk:-8}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -d /gwn ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + msg_info "Application is updated via the web interface!" + exit +} + +start +build_container +description + +msg_ok "Completed successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}https://${IP}:8443${CL}" diff --git a/install/gwn-manager-install.sh b/install/gwn-manager-install.sh new file mode 100644 index 000000000..6e3bd6f73 --- /dev/null +++ b/install/gwn-manager-install.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: Slaviša Arežina (tremor021) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://www.grandstream.com/products/networking-solutions/wi-fi-management/product/gwn-manager + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt install -y \ + xfonts-utils \ + fontconfig +msg_ok "Installed Dependencies" + +msg_info "Setting up GWN Manager" +RELEASE=$(curl -s https://www.grandstream.com/support/tools#gwntools \ + | grep -oP 'https://firmware\.grandstream\.com/GWN_Manager-[^"]+-Ubuntu\.tar\.gz') +download_with_progress "$RELEASE" "/tmp/gwnmanager.tar.gz" +cd /tmp +tar -xzf gwnmanager.tar.gz --strip-components=1 +$STD ./install +msg_ok "Setup GWN Manager" + +msg_info "Creating Service" +cat </etc/systemd/system/gwnmanager.service +[Unit] +Description=GWN Manager +After=network.target + +[Service] +Type=simple +WorkingDirectory=/gwn +ExecStart=/gwn/gwn start +Restart=on-failure +RestartSec=10 + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now gwnmanager +msg_ok "Created Service" + +motd_ssh +customize +cleanup_lxc