dot dot dotfiles
at main 24 lines 915 B view raw
1#!/usr/bin/bash 2 3NC='\033[0m' 4ARG='\033[0;31m' # red 5TXT='\033[0;32m' # green, or 1;32m for light green 6SYM='\u2192' # right arrow 7 8if [ "$1" == "" ] || [ "$1" == "help" ]; then 9 echo -e "${SYM} ${ARG}no arguments${NC} : ${TXT}Display these help messages.${NC}" 10 echo -e "${SYM} ${ARG}on/start${NC} : ${TXT}Turn tailscale service on.${NC}" 11 echo -e "${SYM} ${ARG}off/stop${NC} : ${TXT}Turn tailscale service off${NC}" 12 echo -e "${SYM} ${ARG}status${NC} : ${TXT}Display status of tailscale service${NC}" 13elif [ "$1" == "start" ] || [ "$1" == "on" ]; then 14 sudo systemctl start tailscaled.service 15 sudo tailscale up --ssh 16elif [ "$1" == "stop" ] || [ "$1" == "off" ]; then 17 sudo tailscale down 18 sudo systemctl stop tailscaled.service 19elif [ "$1" == "status" ]; then 20 tailscale status 21else 22 echo "server only accepts 'start', 'on', 'stop', 'off', or 'status'" 23 exit 1 24fi