remove verbose option

This commit is contained in:
James Barnett 2016-04-25 13:18:38 -05:00
parent 7ad490c283
commit 1cffe0260a
3 changed files with 2 additions and 17 deletions

View file

@ -13,6 +13,3 @@
# Snapper cleanup algorithm to use.
#CLEANUP_ALGORITHM="number"
# Set to "true" to make commands verbose
#VERBOSE="false"

View file

@ -29,20 +29,12 @@ fi
cleanupalgo=${CLEANUP_ALGORITHM:-"number"}
description=${POST_DESCRIPTION:-"$(echo $(ps -C pacman -o args=) | sed 'sX/usr/bin/pacmanXpacmanXg')"}
configurations=${CONFIGS:-"root"}
be_verbose=${VERBOSE:-"false"}
PREFILE_PREFIX="/usr/share/libalpm/hooks.bin/snap-pac/.pre"
for x in $configurations; do
if [ -f $PREFILE_PREFIX"_"$x ]; then
SNAPPERPACPRE=$(cat $PREFILE_PREFIX"_"$x)
snapper --config $x create --cleanup-algorithm $cleanupalgo --type post --pre-number $SNAPPERPACPRE --description "$description"
case "${be_verbose}" in
true)
snapper -v --config $x create --cleanup-algorithm $cleanupalgo --type post --pre-number $SNAPPERPACPRE --description "$description"
rm -v $PREFILE_PREFIX"_"$x;;
*)
snapper --config $x create --cleanup-algorithm $cleanupalgo --type post --pre-number $SNAPPERPACPRE --description "$description"
rm $PREFILE_PREFIX"_"$x
esac
rm $PREFILE_PREFIX"_"$x
else
echo "WARNING: $PREFILE_PREFIX"_"$x does not exist, so no post snapshot will be taken. If you are initially installing snap-pac, this is normal."
fi

View file

@ -29,11 +29,7 @@ fi
cleanupalgo=${CLEANUP_ALGORITHM:-"number"}
description=${POST_DESCRIPTION:-"$(echo $(ps -C pacman -o args=) | sed 'sX/usr/bin/pacmanXpacmanXg')"}
configurations=${CONFIGS:-"root"}
be_verbose=${VERBOSE:-"false"}
PREFILE_PREFIX="/usr/share/libalpm/hooks.bin/snap-pac/.pre"
for x in $configurations; do
case "${be_verbose}" in
true) snapper -v --config $x create --type pre --cleanup-algorithm $cleanupalgo --print-number --description "$description" > $PREFILE_PREFIX"_"$x;;
*) snapper --config $x create --type pre --cleanup-algorithm $cleanupalgo --print-number --description "$description" > $PREFILE_PREFIX"_"$x
esac
snapper --config $x create --type pre --cleanup-algorithm $cleanupalgo --print-number --description "$description" > $PREFILE_PREFIX"_"$x
done