avoid defaults carrying over
This commit is contained in:
parent
268256123e
commit
ea654087df
1 changed files with 6 additions and 4 deletions
10
snap-pac
10
snap-pac
|
|
@ -53,18 +53,20 @@ for CONFIG in $SNAPPER_CONFIGS; do
|
||||||
if [[ $CONFIG == "root" ]]; then
|
if [[ $CONFIG == "root" ]]; then
|
||||||
PACMAN_PRE_POST="yes"
|
PACMAN_PRE_POST="yes"
|
||||||
fi
|
fi
|
||||||
|
PACMAN_PRE_DESCRIPTION="$pacman_cmd"
|
||||||
|
PACMAN_POST_DESCRIPTION="$pacman_cmd"
|
||||||
|
PACMAN_CLEANUP_ALGORITHM="number"
|
||||||
source /etc/snapper/configs/$CONFIG
|
source /etc/snapper/configs/$CONFIG
|
||||||
|
|
||||||
[[ $PACMAN_PRE_POST != "yes" ]] && continue
|
[[ $PACMAN_PRE_POST != "yes" ]] && continue
|
||||||
|
|
||||||
prefile="/tmp/snap-pac-pre_$CONFIG"
|
prefile="/tmp/snap-pac-pre_$CONFIG"
|
||||||
snapper_cmd="snapper --config $CONFIG create --type $pre_or_post --cleanup-algorithm ${PACMAN_CLEANUP_ALGORITHM:-"number"}"
|
snapper_cmd="snapper --config $CONFIG create --type $pre_or_post --cleanup-algorithm $PACMAN_CLEANUP_ALGORITHM"
|
||||||
|
|
||||||
if [[ "$pre_or_post" == "pre" ]]; then
|
if [[ "$pre_or_post" == "pre" ]]; then
|
||||||
$snapper_cmd --description "${PACMAN_PRE_DESCRIPTION:-$pacman_cmd}" --print-number > $prefile
|
$snapper_cmd --description "$PACMAN_PRE_DESCRIPTION" --print-number > $prefile
|
||||||
elif [[ -f $prefile ]]; then
|
elif [[ -f $prefile ]]; then
|
||||||
$snapper_cmd --description "${PACMAN_POST_DESCRIPTION:-$pacman_cmd}" --pre-number $(< $prefile)
|
$snapper_cmd --description "$PACMAN_POST_DESCRIPTION" --pre-number $(< $prefile)
|
||||||
rm $prefile
|
rm $prefile
|
||||||
else
|
else
|
||||||
echo "WARNING: $prefile does not exist, so no post snapshot will be taken. If you are initially installing snap-pac, this is normal."
|
echo "WARNING: $prefile does not exist, so no post snapshot will be taken. If you are initially installing snap-pac, this is normal."
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue