update for v.0.6.7
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
# pair of systemd service and timer-units.
|
# pair of systemd service and timer-units.
|
||||||
|
|
||||||
progname="${0##*/}"
|
progname="${0##*/}"
|
||||||
version="0.6.6"
|
version="0.6.7"
|
||||||
|
|
||||||
# global variables
|
# global variables
|
||||||
args=
|
args=
|
||||||
@@ -113,22 +113,22 @@ check_prerequisites () {
|
|||||||
test -p "$BTRFS_PIPE" && mkfifo "$BTRFS_PIPE"
|
test -p "$BTRFS_PIPE" && mkfifo "$BTRFS_PIPE"
|
||||||
|
|
||||||
# requested binaries
|
# requested binaries
|
||||||
which awk >/dev/null 2>&1 || { printf "'awk' is not installed." && exit 1; }
|
command -pv awk >/dev/null 2>&1 || { printf "'awk' is not installed." && exit 1; }
|
||||||
which sed >/dev/null 2>&1 || { printf "'sed' is not installed." && exit 1; }
|
command -pv sed >/dev/null 2>&1 || { printf "'sed' is not installed." && exit 1; }
|
||||||
which ssh >/dev/null 2>&1 || { printf "'ssh' is not installed." && exit 1; }
|
command -pv ssh >/dev/null 2>&1 || { printf "'ssh' is not installed." && exit 1; }
|
||||||
which scp >/dev/null 2>&1 || { printf "'scp' is not installed." && exit 1; }
|
command -pv scp >/dev/null 2>&1 || { printf "'scp' is not installed." && exit 1; }
|
||||||
which btrfs >/dev/null 2>&1 || { printf "'btrfs' is not installed." && exit 1; }
|
command -pv btrfs >/dev/null 2>&1 || { printf "'btrfs' is not installed." && exit 1; }
|
||||||
which findmnt >/dev/null 2>&1 || { printf "'findmnt' is not installed." && exit 1; }
|
command -pv findmnt >/dev/null 2>&1 || { printf "'findmnt' is not installed." && exit 1; }
|
||||||
which systemd-cat >/dev/null 2>&1 || { printf "'systemd-cat' is not installed." && exit 1; }
|
command -pv systemd-cat >/dev/null 2>&1 || { printf "'systemd-cat' is not installed." && exit 1; }
|
||||||
which snapper >/dev/null 2>&1 || { printf "'snapper' is not installed." && exit 1; }
|
command -pv snapper >/dev/null 2>&1 || { printf "'snapper' is not installed." && exit 1; }
|
||||||
|
|
||||||
# optional binaries
|
# optional binaries
|
||||||
which attr >/dev/null 2>&1 || { printf "'attr' is not installed." && exit 1; }
|
command -pv attr >/dev/null 2>&1 || { printf "'attr' is not installed." && exit 1; }
|
||||||
which ionice >/dev/null 2>&1 && { do_ionice_cmd=1; }
|
command -pv ionice >/dev/null 2>&1 && { do_ionice_cmd=1; }
|
||||||
which notify-send >/dev/null 2>&1 && { donotify=1; }
|
command -pv notify-send >/dev/null 2>&1 && { donotify=1; }
|
||||||
which pv >/dev/null 2>&1 && { do_pv_cmd=1; }
|
command -pv pv >/dev/null 2>&1 && { do_pv_cmd=1; }
|
||||||
which tape-admin >/dev/null 2>&1 && { tape_admin_cmd=1; }
|
command -pv tape-admin >/dev/null 2>&1 && { tape_admin_cmd=1; }
|
||||||
which nc >/dev/null 2>&1 && { nc_cmd=1; }
|
command -pv nc >/dev/null 2>&1 && { nc_cmd=1; }
|
||||||
|
|
||||||
if [ "$(id -u)" -ne 0 ] ; then printf "%s: must be run as root\n", "$progname" ; exit 1 ; fi
|
if [ "$(id -u)" -ne 0 ] ; then printf "%s: must be run as root\n", "$progname" ; exit 1 ; fi
|
||||||
|
|
||||||
@@ -354,7 +354,8 @@ get_answer_yes_no () {
|
|||||||
|
|
||||||
# hack: answer is a global variable, using it for preselection
|
# hack: answer is a global variable, using it for preselection
|
||||||
while [ "$i" = "none" ]; do
|
while [ "$i" = "none" ]; do
|
||||||
read -r "$message" i
|
printf "%s" "$message"
|
||||||
|
read -r i
|
||||||
|
|
||||||
case $i in
|
case $i in
|
||||||
y|Y|yes|Yes)
|
y|Y|yes|Yes)
|
||||||
@@ -443,7 +444,7 @@ get_archive_last_sync_id () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get_backupdir () {
|
get_backupdir () {
|
||||||
backup_dir=$1
|
backup_dir="$1"
|
||||||
|
|
||||||
if [ "$verbose" -ge 2 ]; then
|
if [ "$verbose" -ge 2 ]; then
|
||||||
printf "${BLUE}get_backupdir() ...${NO_COLOR}\n" $snapper_config
|
printf "${BLUE}get_backupdir() ...${NO_COLOR}\n" $snapper_config
|
||||||
@@ -1381,7 +1382,7 @@ parse_params () {
|
|||||||
nc -w 3 -z "$remote" "$port" > /dev/null || \
|
nc -w 3 -z "$remote" "$port" > /dev/null || \
|
||||||
die "Can't connect to remote host."
|
die "Can't connect to remote host."
|
||||||
else
|
else
|
||||||
"$ssh" which sh >/dev/null 2>&1 || \
|
"$ssh" command -pv sh >/dev/null 2>&1 || \
|
||||||
{ printf "'remote shell' is not working!\n \
|
{ printf "'remote shell' is not working!\n \
|
||||||
Please correct your public authentication and try again.\n" && exit 1; }
|
Please correct your public authentication and try again.\n" && exit 1; }
|
||||||
fi
|
fi
|
||||||
@@ -3297,7 +3298,7 @@ trap trapkill TERM INT
|
|||||||
check_prerequisites
|
check_prerequisites
|
||||||
|
|
||||||
# validate commandline options, set resonable defaults
|
# validate commandline options, set resonable defaults
|
||||||
parse_params $@
|
parse_params "$@"
|
||||||
|
|
||||||
# parse infos for backup medium
|
# parse infos for backup medium
|
||||||
get_media_infos
|
get_media_infos
|
||||||
|
|||||||
Reference in New Issue
Block a user