set name variable
This commit is contained in:
parent
6105acf78b
commit
d162241a1b
1 changed files with 4 additions and 5 deletions
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
declare -r SNAPPER_CONFIG_FILE=/etc/conf.d/snapper
|
declare -r SNAPPER_CONFIG_FILE=/etc/conf.d/snapper
|
||||||
declare -r DESC_LIMIT=48
|
declare -r DESC_LIMIT=48
|
||||||
|
declare -r name="snap-pac"
|
||||||
declare PACMAN_ABORT_ON_FAIL="no"
|
declare PACMAN_ABORT_ON_FAIL="no"
|
||||||
|
|
||||||
out() { printf "$1 $2\n" "${@:3}"; }
|
out() { printf "$1 $2\n" "${@:3}"; }
|
||||||
|
|
@ -81,21 +82,19 @@ for CONFIG in $SNAPPER_CONFIGS; do
|
||||||
|
|
||||||
[[ $PACMAN_PRE_POST == "no" ]] && continue
|
[[ $PACMAN_PRE_POST == "no" ]] && continue
|
||||||
|
|
||||||
prefile="/tmp/snap-pac-pre_$CONFIG"
|
prefile="/tmp/$name-pre_$CONFIG"
|
||||||
snapper_cmd="snapper --config $CONFIG create --type $pre_or_post --cleanup-algorithm $PACMAN_CLEANUP_ALGORITHM --print-number"
|
snapper_cmd="snapper --config $CONFIG create --type $pre_or_post --cleanup-algorithm $PACMAN_CLEANUP_ALGORITHM --print-number"
|
||||||
|
|
||||||
x=$((x+1))
|
x=$((x+1))
|
||||||
|
|
||||||
printf " %s " "$CONFIG"
|
printf " %s " "$CONFIG"
|
||||||
case "$pre_or_post" in
|
case "$pre_or_post" in
|
||||||
pre)
|
pre) printf "$($snapper_cmd --description "$(truncate_description $PACMAN_PRE_DESCRIPTION)" | tee "$prefile")\n" ;;
|
||||||
printf "$($snapper_cmd --description "$(truncate_description $PACMAN_PRE_DESCRIPTION)" | tee "$prefile")\n"
|
|
||||||
;;
|
|
||||||
post)
|
post)
|
||||||
if [[ -f $prefile ]]; then
|
if [[ -f $prefile ]]; then
|
||||||
printf "$($snapper_cmd --description "$(truncate_description $PACMAN_POST_DESCRIPTION)" --pre-number "$(< "$prefile")")\n"
|
printf "$($snapper_cmd --description "$(truncate_description $PACMAN_POST_DESCRIPTION)" --pre-number "$(< "$prefile")")\n"
|
||||||
else
|
else
|
||||||
warning "%s does not exist, so no post snapshot for %s will be taken. If you are initially installing snap-pac, this is normal." "$prefile" "$CONFIG"
|
warning "%s does not exist, so no post snapshot for %s will be taken. If you are initially installing $name, this is normal." "$prefile" "$CONFIG"
|
||||||
fi
|
fi
|
||||||
rm -f "$prefile"
|
rm -f "$prefile"
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue