Browse Source

add -a switch to beszel-install-agent.sh

Virgil Ollivier 5 months ago
parent
commit
851a3ab892
1 changed files with 5 additions and 2 deletions
  1. 5 2
      bin/beszel-install-agent.sh

+ 5 - 2
bin/beszel-install-agent.sh

@@ -58,6 +58,7 @@ case "$1" in
   printf "  -k                : SSH key (required, or interactive if not provided)\n"
   printf "  -p                : Port (default: $PORT)\n"
   printf "  -u                : Uninstall Beszel Agent\n"
+  printf "  -a                : set daily auto-update agent binary\n"
   printf "  --china-mirrors   : Using GitHub mirror sources to resolve network timeout issues in mainland China\n"
   printf "  -h, --help        : Display this help message\n"
   exit 0
@@ -107,6 +108,8 @@ while [ $# -gt 0 ]; do
   --china-mirrors)
     CHINA_MAINLAND=true
     ;;
+  -a)
+    AUTO_UPDATE=true
   *)
     echo "Invalid option: $1" >&2
     exit 1
@@ -414,8 +417,8 @@ EOF
   systemctl start beszel-agent.service
 
 
-  # enable auto-update if environment variable set up
-  if [ "${AUTO_UPDATE}" == "true" ]; then
+  # enable auto-update if AUTO_UPDATE variable set up
+  if [ "${AUTO_UPDATE}" = true ]; then
     add_autoupdate_service
   else
     # Prompt for auto-update setup