commit 014b8368a070468a96b08f847c1278e856a8c3ce
parent 8e27eca9884229469b7576e195cfb2185697e62c
Author: Slack Coder <slackcoder@server.ky>
Date: Mon, 25 Mar 2024 14:06:30 -0500
Avoid taking STAGING_DIR from environment
The staging directory is deleted in certain cases, taking it from the environment is accident prone.
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/slack-autoupdate b/src/slack-autoupdate
@@ -17,19 +17,19 @@ NOTIFY="${NOTIFY:-no}"
# Reboot after this period for install after a successful update.
#
# Set to empty to disable reboot or 'now' to reboot immediately.
-export REBOOT_TIME="${REBOOT_TIME:-""}"
+REBOOT_TIME="${REBOOT_TIME:-""}"
# Packages are copied here on successful download.
-export PACKAGE_DIR="${PACKAGE_DIR:-/var/spool/slack-autoupdate}"
+PACKAGE_DIR="${PACKAGE_DIR:-/var/spool/slack-autoupdate}"
# Packages are temperarily stored here until success.
-export STAGING_DIR="${STAGING_DIR:-/var/cache/slack-autoupdate/staging}"
+STAGING_DIR="/var/cache/slack-autoupdate/staging"
# Information of interest to the admin on success.
-export UPDATE_INFO="${UPDATE_INFO:-$STAGING_DIR/info.txt}"
+UPDATE_INFO="$STAGING_DIR/info.txt"
# Information of interest to the admin on failure.
-export UPDATE_ERROR="${UPDATE_ERROR:-$STAGING_DIR/error.txt}"
+UPDATE_ERROR="$STAGING_DIR/error.txt"
# Avoid concurrently running with another instance.
if [ "$(ls /var/lock/autoupdate.* 2>/dev/null)" ]; then