diff --git a/README.md b/README.md index 22b3d8e..c19951d 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,10 @@ Lightweight SSH-based update manager for Linux systems. ## Usage -./lanx-update.sh check -./lanx-update.sh update -./lanx-update.sh autoremove -./lanx-update.sh full +./update-manager.sh check +./update-manager.sh update +./update-manager.sh autoremove +./update-manager.sh full ## Hosts file format @@ -27,5 +27,5 @@ server1|192.168.1.10|user ## Config -HOSTS_FILE="/opt/lanx/hosts.conf" +HOSTS_FILE="${HOSTS_FILE:-/opt/update-manager/hosts.conf}" NTFY_URL="" diff --git a/hosts.conf.example b/hosts.conf.example deleted file mode 100644 index f4269a7..0000000 --- a/hosts.conf.example +++ /dev/null @@ -1,3 +0,0 @@ -# name|ip|ssh_user -server1|192.168.1.10|user -server2|192.168.1.20|user diff --git a/update-manager.conf.example b/update-manager.conf.example deleted file mode 100644 index b7013a5..0000000 --- a/update-manager.conf.example +++ /dev/null @@ -1,2 +0,0 @@ -HOSTS_FILE="/opt/lanx/hosts.conf" -NTFY_URL="" diff --git a/lanx-update.sh b/update-manager.sh similarity index 90% rename from lanx-update.sh rename to update-manager.sh index 80b3610..1265088 100755 --- a/lanx-update.sh +++ b/update-manager.sh @@ -1,6 +1,16 @@ #!/usr/bin/env bash -HOSTS_FILE="/opt/lanx/hosts.conf" +#!/usr/bin/env bash + +CONFIG_FILE="/etc/update-manager.conf" + +if [[ -f "$CONFIG_FILE" ]]; then + # shellcheck disable=SC1090 + source "$CONFIG_FILE" +fi + +HOSTS_FILE="${HOSTS_FILE:-./hosts.conf}" +NTFY_URL="${NTFY_URL:-}" check_host() { local name="$1"