tadd various fixes - scripts - random scripts
git clone git://parazyd.org/scripts.git
Log
Files
Refs
---
commit d65759220b6b5d3b81f573dbf50f476ad5007069
parent 102d035f011a9b5ba859d8fff179545bf636a43e
Author: parazyd 
Date:   Wed, 20 Jul 2016 19:37:02 +0200

add various fixes

Diffstat:
  M addrepo.sh                          |       4 ++--
  M autoup                              |       1 +
  M dn                                  |      22 ++++++++++++----------
  M obsolete/scream.sh                  |       4 ++--
  M ys                                  |       4 ++--

5 files changed, 19 insertions(+), 16 deletions(-)
---
diff --git a/addrepo.sh b/addrepo.sh
t@@ -8,11 +8,11 @@ GITOLITE="/home/parazyd/devel/gitolite-admin"
 reponame="$1"
 repodesc="$2"
 repoowner=`awk '/name =/ {print $3}' ~/.gitconfig`
-[[ -n $3 ]] && repoowner="$3"
+[ -n "$3" ] && repoowner="$3"
 
 
 writeconf() {
-        if [[ $repodesc == "unlisted" || $repodesc == "private" ]]; then
+        if [ "$repodesc" == "unlisted" || $repodesc == "private" ]; then
         cat <
diff --git a/autoup b/autoup
t@@ -9,4 +9,5 @@ webdir=dev/random
 test -z "$1" && exit 1 || filename=$(basename $1)
 scp -i "$sshkey" "$1" "${sshuser}@${server}:${webroot}/${webdir}/${filename}"
 echo "https://$server/$webdir/$filename" | xclip -i
+echo "https://$server/$webdir/$filename"
 rm $1
diff --git a/dn b/dn
t@@ -23,19 +23,21 @@ startd() {
 case $1 in
         out|o)
                 startd
-                chattr off && echo "nameserver 127.0.0.1 # out" > /etc/resolv.conf && chattr on
-                exit 0;;
+                chattr off && echo "nameserver 127.0.0.1 # out" > /etc/resolv.conf && chattr on;;
         home|h)
                 stopd
-                chattr off && echo "nameserver 10.0.1.1 # home" > /etc/resolv.conf && chattr on
-                exit 0;;
-        bridge)
+                chattr off && echo "nameserver 10.0.1.1 # home" > /etc/resolv.conf && chattr on;;
+        bridge|b)
                 stopd
-                chattr off && echo "nameserver 172.16.17.1 # bridge" > /etc/resolv.conf && chattr on
-                exit 0;;
+                chattr off && echo "nameserver 172.16.17.1 # bridge" > /etc/resolv.conf && chattr on;;
+        jabba)
+                stopd
+                chattr off && echo "nameserver 192.168.43.1 # jabba" > /etc/resolv.conf && chattr on;;
+        goog|g)
+                stopd
+                chattr off && echo "nameserver 8.8.8.8 # google" > /etc/resolv.conf && chattr on;;
         *)
                 echo "current set as: `awk '{print $4}' /etc/resolv.conf`"
-                echo "usage: `basename $0` {home|out}";;
+                echo "usage: `basename $0` {home|out}"
+                exit 1;;
 esac
-
-exit 1
diff --git a/obsolete/scream.sh b/obsolete/scream.sh
t@@ -3,8 +3,8 @@
 POSIT=/sys/devices/platform/hdaps/position
 
 while true; do
-    val1=`cat $POSIT | awk -F, '{print $1}' | sed 's/(//'`
-    val2=`cat $POSIT | awk -F, '{print $2}' | sed 's/)//'`
+    val1=`awk -F, '{print $1}' $POSIT | sed 's/(//'`
+    val2=`awk -F, '{print $2}' $POSIT | sed 's/)//'`
 
     while [[ $val1 -lt '-370' && $val1 -gt '-375' ]]; do
         echo "AHAHHAHAA!!"
diff --git a/ys b/ys
t@@ -15,9 +15,9 @@ usage() {
 EOF
 }
 
-num=3
+num=5
 regex='^.*]*>\([^<]*\).*$'
-output='\2 - http://youtube.com\1'
+output='\2 - https://youtube.com\1'
 
 while getopts "hn:tu" OPT; do
     case  $OPT in