From 455b8718ddf8767ca4871d444b0ed2f728727838 Mon Sep 17 00:00:00 2001 From: James Barnett Date: Sat, 24 Jun 2017 22:06:38 -0400 Subject: [PATCH] allow nonroot user to see help --- bin/snap-sync | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/snap-sync b/bin/snap-sync index b2d2d10..85f0175 100755 --- a/bin/snap-sync +++ b/bin/snap-sync @@ -78,9 +78,6 @@ trapkill() { die "Exited due to user intervention." } -[[ $EUID -ne 0 ]] && die "Script must be run as root." -! [[ -f $SNAPPER_CONFIG ]] && die "$SNAPPER_CONFIG does not exist." - trap 'traperror ${LINENO} $? "$BASH_COMMAND" $BASH_LINENO "${FUNCNAME[@]}"' ERR trap trapkill SIGTERM SIGINT @@ -141,6 +138,9 @@ while [[ $# -gt 0 ]]; do esac done +[[ $EUID -ne 0 ]] && die "Script must be run as root." +! [[ -f $SNAPPER_CONFIG ]] && die "$SNAPPER_CONFIG does not exist." + description=${description:-"latest incremental backup"} uuid_cmdline=${uuid_cmdline:-"none"} noconfirm=${noconfirm:-"no"}