]> git.nbdom.net Git - nb.git/commitdiff
bin/nb-install
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 25 Feb 2017 00:36:50 +0000 (00:36 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 25 Feb 2017 00:36:50 +0000 (00:36 +0000)
bin/nb-install
etc/profile.d/functions

index 550017faf5e2090ffbbf9c5655daea34f72cd76f..aa82dc50551b39581f420cf02519cf90b14808a9 100755 (executable)
@@ -53,6 +53,7 @@ fdiff() {
 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
index 1d0da2f829c290e4f5041229ac254231e75fff47..173ad523b9abcd5c4ef71910a8c4911c39eaafee 100644 (file)
@@ -132,10 +132,11 @@ shell_help() {
   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
@@ -147,7 +148,7 @@ shell_help() {
 
 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
@@ -424,12 +425,14 @@ jpg2avi() {
 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