blob: 12738afef38f17f5fd99371dc5d2795d0d86f20c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#!/bin/sh
# Toggle the snx-rs (Check Point) tunnel.
#
# Refresh the waybar custom/snx-vpn module immediately with SIGRTMIN+9.
set -eu
state=$(timeout 2 snxctl status 2>/dev/null || echo Disconnected)
case "$state" in
*"Disconnected"*)
setsid -f snxctl connect >/tmp/snxctl.log 2>&1 &
;;
*)
snxctl disconnect >/dev/null 2>&1 || true
;;
esac
pid=$(pidof waybar || true)
[ -n "$pid" ] && kill -SIGRTMIN+9 "$pid" 2>/dev/null || true
|