[arkdep] Only untar update.sh if ARKDEP_ROOT unset

This commit is contained in:
Dennis ten Hoove 2024-09-10 04:41:35 +02:00
parent 23e6ec2e86
commit a1db555af7
No known key found for this signature in database
GPG key ID: 2BA91DC2563B83D1

4
arkdep
View file

@ -1198,7 +1198,8 @@ deploy () {
done
# Check if there is an update script available
if tar -xf $arkdep_dir/cache/${data[0]}.tar.${data[1]} -C $arkdep_dir/cache/ ./${data[0]}-update.sh 2> /dev/null && [[ ! -n $ARKDEP_ROOT ]]; then
if [[ ! -n $ARKDEP_ROOT ]]; then
if tar -xf $arkdep_dir/cache/${data[0]}.tar.${data[1]} -C $arkdep_dir/cache/ ./${data[0]}-update.sh 2> /dev/null; then
printf '\e[1;34m-->\e[0m\e[1m Running update script\e[0m\n'
# Run the migration script if provided
(source $arkdep_dir/cache/${data[0]}-update.sh)
@ -1206,6 +1207,7 @@ deploy () {
printf '\e[1;34m-->\e[0m\e[1m Removing update script\e[0m\n'
rm $arkdep_dir/cache/${data[0]}-update.sh
fi
fi
# Image deployment finished, allow for interupts again
trap 'echo "User interupt received, canceling cleanup step"; unlock_and_quit 4' INT TERM