bins

handy scripts
git clone git://popovic.xyz/bins.git
Log | Files | Refs | LICENSE

bar-server (404B)


      1 #!/bin/zsh
      2 
      3 response=$(wget -4 --server-response --max-redirect=0 popovic.xyz:80)
      4 
      5 if [[ $response == *"Connection refused"* ]]
      6 	then
      7 		emoji="" > $XDG_DATA_HOME/status/server-status.info
      8 	else
      9 		emoji="" > $XDG_DATA_HOME/status/server-status.info
     10 fi
     11 
     12 echo ":$emoji"
     13 
     14 case $BLOCK_BUTTON in
     15     1) nextcloud ;;
     16 	3) setsid -f "$TERMINAL" -e ssh server;;
     17 	6) "$TERMINAL" -e "$EDITOR" "$0" ;;
     18 esac
     19