diff options
author | Erich Eckner <git@eckner.net> | 2016-11-23 10:29:25 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2016-11-23 10:29:25 +0100 |
commit | b26ebdfa52651603c57ae12972b2331005ec6fe3 (patch) | |
tree | a7ba00b0b6585468165d08183b944b4e4a326908 /lastBackups.in | |
parent | 6885a1238cc6b8ff7dd859bc636882a974523b3d (diff) | |
download | hardlinkedBackups-b26ebdfa52651603c57ae12972b2331005ec6fe3.tar.xz |
lastBackups gibt nun Fehler bei überflüssigen/falschen Parametern
Diffstat (limited to 'lastBackups.in')
-rwxr-xr-x | lastBackups.in | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/lastBackups.in b/lastBackups.in index e0cefd2..ce27350 100755 --- a/lastBackups.in +++ b/lastBackups.in @@ -5,22 +5,31 @@ [ -r "#ETCDIR#/backup.conf" ] && \ . "#ETCDIR#/backup.conf" -if [ $# -eq 1 ] -then - if [ "$1" == "--help" ] - then - >&2 echo \ +usage () { + >&2 echo \ 'Usage: lastBackups Show information about date of last backups and warn about outdated ones. Options: #HELPTEXT# #' - exit 0 + [ -n "$1" ] && exit $1 + exit 1 +} + +if [ $# -eq 1 ] +then + if [ "$1" == "--help" ] + then + usage 0 elif [ "$1" == "--version" ] then >&2 echo '#VERSION#' exit 0 fi + usage +elif [ $# -gt 1 ] +then + usage fi unset namen |