summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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