summaryrefslogtreecommitdiff
path: root/lastBackups.in
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2016-11-23 10:29:25 +0100
committerErich Eckner <git@eckner.net>2016-11-23 10:29:25 +0100
commitb26ebdfa52651603c57ae12972b2331005ec6fe3 (patch)
treea7ba00b0b6585468165d08183b944b4e4a326908 /lastBackups.in
parent6885a1238cc6b8ff7dd859bc636882a974523b3d (diff)
downloadhardlinkedBackups-b26ebdfa52651603c57ae12972b2331005ec6fe3.tar.xz
lastBackups gibt nun Fehler bei überflüssigen/falschen Parametern
Diffstat (limited to 'lastBackups.in')
-rwxr-xr-xlastBackups.in21
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