]> git.nbdom.net Git - nb.git/commitdiff
etc/profile.d/functions
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 29 Mar 2019 01:27:11 +0000 (01:27 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 29 Mar 2019 01:27:11 +0000 (01:27 +0000)
etc/profile.d/functions
lib/nb-update/repo.sh
lib/postgres/nginx_var.sh

index 96c3be7fdcc4d395dbe9e05e528dbea8d551d8aa..73275331714c4f304e2391c9fa5cd6fd25258aa7 100755 (executable)
@@ -23,34 +23,34 @@ which timeout > /dev/null || timeout() {
 
 which realpath > /dev/null || realpath() {
        #perl -MFile::Spec -MCwd -e 'print File::Spec->rel2abs( Cwd::abs_path($ARGV[0]) )."\n" if -e $ARGV[0]' "$1"
-  local pwd_bak=$PWD
+       local pwd_bak=$PWD
 
-  [ -e "$1" ] || return
+       [ -e "$1" ] || return
 
-  if [ -d "$1" ]; then
-       cd "$1" || return
-       pwd -P
+       if [ -d "$1" ]; then
+               cd "$1" || return
+               pwd -P
        else
 
-       local BASENAME="$(basename "$1")"
-       local LINK=$(readlink "$BASENAME")
-       cd "$(dirname "$1")"
+               local BASENAME="$(basename "$1")"
+               local LINK=$(readlink "$BASENAME")
+               cd "$(dirname "$1")"
 
-       while [ "$LINK" ]; do
-       cd "$(dirname "$LINK")"
-       LINK=$(readlink "$BASENAME")
-       done
+               while [ "$LINK" ]; do
+                       cd "$(dirname "$LINK")"
+                       LINK=$(readlink "$BASENAME")
+               done
 
-       local DIR="$(pwd -P)"
-       if [ "$DIR" = "/" ]; then
-               echo "$DIR$BASENAME"
-       else
-               echo "$DIR/$BASENAME"
-       fi
+               local DIR="$(pwd -P)"
+               if [ "$DIR" = "/" ]; then
+                       echo "$DIR$BASENAME"
+               else
+                       echo "$DIR/$BASENAME"
+               fi
 
-  fi
+       fi
 
-  cd "$pwd_bak"
+       cd "$pwd_bak"
 }
 
 # NB 12.03.19 if ! which realpath > /dev/null; then
@@ -850,14 +850,14 @@ cron_d_install() {
 # root 20.03.19                shell_help_noarg "$usage" "--help" && return 1
 
 # NB 20.03.19  #elif [ $# -eq 3 ]; then
-# NB 20.03.19  elif [ ! -e "$1" ]; then
-# NB 20.03.19          fname=$1; shift
-# NB 20.03.19          tmp="/tmp/cron_d_install.$$"
-# NB 20.03.19          trap "rm -f $tmp*" RETURN
-# NB 20.03.19          file="$tmp.cron"
-# root 20.03.19     cat <<< "$1" > "$file"; shift
-# NB 20.03.19          echo "$1" > "$file"; shift
-# NB 20.03.19          exp=$1; shift
+       elif [ ! -e "$1" ]; then
+               fname=$1; shift
+               tmp="/tmp/cron_d_install.$$"
+               trap "rm -f $tmp*" RETURN
+               file="$tmp.cron"
+# NB 29.03.19 # root 20.03.19     cat <<< "$1" > "$file"; shift
+               echo "$1" > "$file"; shift
+               exp=$1; shift
 
        else
                file=$1; shift
index a9d8379154be5639f0e34ea823ffe15928337923..af1b646cf644fbadddcd4a0cdcb58a6b7a6da31b 100644 (file)
@@ -12,3 +12,4 @@ git_change_url "git@git.nbdom.net:root.git" "git.nbdom.net:/home/git/root.git"
 git_change_url "git@git.nbdom.net:nbdom.git" "git.nbdom.net:/home/git/nbdom.git"
 git_change_url "pi.vpn.nbdom.net:/backups/big/home/git/puppet.git" "git@big.nbdom.net:puppet.git"
 #git_change_url "git@git.nbdom.net:pi.git" "git.nbdom.net:/home/git/pi.git"
+return 0
index 0acb66531db5e04ff27fa0dce3c18d28d007b1fe..442b42bcb19844104ba5125a54ba1439cf427971 100755 (executable)
@@ -2,5 +2,5 @@
 http_get https://nginx.org/en/docs/varindex.html \
 | xmllint --html --xpath "/html/body//div[@id=\"content\"]//p" - 2>/dev/null \
 | sed -E -e "s,<a href=\"([^\"]+)\">([^<]+)</a> *(\(([^\)]+)\))?,https://nginx.org/en/docs/\1\t\2\t\4\n,g" -e "s,<[^>]+>,,g" \
-| grep -v "^ *$"  sed "s,(\([^(]\+\))$,\1,g" \
+| grep -v "^ *$" | sed "s,(\([^(]\+\))$,\1,g" \
 | awk 'BEGIN{FS="\t"}{print $2"\t"$3"\t"$1}' \