Some modifications, tailscale scripts
This commit is contained in:
32
bin/tscale
Executable file
32
bin/tscale
Executable file
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source ~/.dotfiles/nfrc.sh
|
||||
|
||||
which tailscale > /dev/null || {
|
||||
echo Tailscale not installed
|
||||
exit 1
|
||||
}
|
||||
|
||||
[ -z "$1" ] && {
|
||||
echo "No args"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
"u"|"up")
|
||||
endpoint=$2
|
||||
|
||||
[ -z "$endpoint" ] && {
|
||||
endpoint=$(tailscale status | grep "exit node" | awk '{print $2}' | $FMENU 'Select server')
|
||||
[ -z "$endpoint" ] && exit 1
|
||||
}
|
||||
|
||||
tailscale set --exit-node="$endpoint"
|
||||
tailscale up
|
||||
;;
|
||||
"d"|"down")
|
||||
tailscale set --exit-node=
|
||||
tailscale up
|
||||
;;
|
||||
esac
|
Reference in New Issue
Block a user