if [ -e /etc/nb/cron.no ]; then
rm -f /etc/cron.d/nb
else
+ #shell_help_noarg "zaza" "$@" && exit 0
cron_d_install "$NB_ROOT/etc/cron/nb" "nb-update|$NB_ROOT|NB_LOG" && verbose "Cron: $NB_ROOT/etc/cron/nb"
#cron_d_install "test" "" "nico.*true" && verbose "Cron: nico"
fi
for i in $@; do
case "$i" in
-h|-help|--help)
- case $OSTYPE in
- darwin*) printf "$msg\n" ;;
- *) echo -e "$msg" ;;
- esac
+ printf "$msg\n"
+# NB 25.02.17 case $OSTYPE in
+# NB 25.02.17 darwin*) printf "$msg\n" ;;
+# NB 25.02.17 *) echo -e "$msg" ;;
+# NB 25.02.17 esac
return 0
;;
esac
shell_help_noarg() {
#
- # Print help message and return true if args contains -?-h(elp)? or is empty
+ # Wrapper for shell_help
#
local msg=""
if [ "$#" -gt 0 ]; then
cron_d_install() {
local usage fname file exp cron tmp test
usage="Usage: $FUNCNAME [-t|--test] [CRON_D_FILE] [IGNORE_REGEXP] or [NAME] [CRON_D_CONTENT] [IGNORE_REGEXP]"
+ #shell_help_noarg "$usage" "$@" && return 1
+ #shell_help "$usage" "$@" && return 1
+ [ -z "$*" ] && echo "$usage" && return 1
if ! perl -e '' 2>/dev/null; then
- echo "cron_d_install: can't run perl" 1>&2
+ echo "cron_d_install: please install perl" 1>&2
return 1
fi
- shell_help_noarg "$usage" "$@" && return 1
if [ "$#" -gt 0 ]; then
case "$1" in -t|--test) test=1; shift ;; esac
fi