mostly fixes
[distro-setup] / brc2
diff --git a/brc2 b/brc2
index 4877c3f25e0af35708135e86e5ee72b64d7bd73a..1905c792569e431e9b2ed9124236644e58a140d7 100644 (file)
--- a/brc2
+++ b/brc2
@@ -110,6 +110,12 @@ rootrsync() {
   s rsync -e "ssh -F /root/.ssh/confighome" "$@"
 }
 
+zcheck() {
+  s ssh bow DISPLAY=:0 scrot /tmp/oegu.jpg
+  s scp bow:/tmp/oegu.jpg /t
+  s ssh bow rm /tmp/oegu.jpg
+  feh /t/oegu.jpg
+  }
 
 slemacs() {
   local arg rtime v
@@ -504,7 +510,7 @@ srun() {
   fg &>/dev/null ||:
 }
 
-sm() {
+sm() { # switch mail host
   local tmp keyhash
   c /
   # run latest
@@ -517,6 +523,19 @@ sm() {
   s jrun switch-mail-host "$@"
   return $ret
 }
+sh2() { # switch host2
+  local tmp keyhash
+  c /
+  # run latest
+  keyhash=$(s ssh-keygen -lf /root/.ssh/home  | awk '{print $2}')
+  tmp=$(s ssh-add -l | awk '$2 == "'$keyhash'"')
+  if [[ ! $tmp ]]; then
+    s ssh-add /root/.ssh/home
+  fi
+  install-my-scripts
+  s jrun switch-host2 "$@"
+  return $ret
+}
 
 # shellcheck disable=SC2120
 lipush() {
@@ -1718,16 +1737,28 @@ EOF
   fi
 }
 
-# alert when a page goes live. not urgent.
+# alert when a page goes live.
 alert200() {
+  local quiet url tmpdir
+  quiet=false
+  case $1 in
+    # dont send a diff of the html. some html is not very readable
+    -q) quiet=true
+        shift
+        ;;
+  esac
   url="$1"
   tmpdir="$(mktemp -d)"
   cd $tmpdir
   while true; do
-    if torsocks wget -q "$url"; then
-      alertme $tmpdir
+    if wget -q "$url"; then
+      if $quiet; then
+        echo | daylert 200
+      else
+        alertme $tmpdir
+      fi
     fi
-    sleep $(( 600 + RANDOM % 300 ))
+    sleep $(( 120 + RANDOM % 300 ))
   done
 }