diff options
Diffstat (limited to 'src/rc.slack-autoupdate')
-rw-r--r-- | src/rc.slack-autoupdate | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/rc.slack-autoupdate b/src/rc.slack-autoupdate index 9563388..ba5f847 100644 --- a/src/rc.slack-autoupdate +++ b/src/rc.slack-autoupdate @@ -1,6 +1,6 @@ #!/bin/bash # -# Automatically update your system on reboot using packages in the UPDATE_DIR. +# Automatically update your system on reboot using packages in the PACKAGE_DIR. # # Sometimes there are additional steps to make when your kernel is updated. # You can define these in a custom 'install-kernel' command which this script @@ -11,9 +11,9 @@ export PATH=$PATH:/usr/local/bin:/usr/local/sbin # Where packages are stored pending installation. You can use sub-directories # to order and group packages. -UPDATE_DIR="/var/spool/slack-autoupdate" +PACKAGE_DIR="/var/spool/slack-autoupdate" -UPDATES="$(find "$UPDATE_DIR" -name '*.t*z' | sort)" +UPDATES="$(find "$PACKAGE_DIR" -name '*.t*z' | sort)" if [ -z "$UPDATES" ]; then exit 0 @@ -37,6 +37,8 @@ if [ "$OLD_KERNEL" != "$NEW_KERNEL" ]; then fi # All package updates have been processed. -find "$UPDATE_DIR" -mindepth 1 | xargs rm -fr +# +# This will error out if PACKAGE_DIR is accidentally unset. +find "$PACKAGE_DIR" -mindepth 1 | xargs rm -fr reboot |