feat(nixos): add QEMU/KVM guest support and update VirtualBox documentation
This commit is contained in:
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/bin/zsh
|
||||
|
||||
# Импортируем ваши переменные и функции
|
||||
SSH_PROXY_PID_FILE="/tmp/ssh_proxy.pid"
|
||||
|
||||
sshp-status-check() {
|
||||
[ -f "$SSH_PROXY_PID_FILE" ] && kill -0 $(cat "$SSH_PROXY_PID_FILE") 2>/dev/null
|
||||
}
|
||||
|
||||
sshp-start() {
|
||||
ssh -fN -D 127.0.0.1:1080 fl-vps
|
||||
pgrep -f "ssh -fN -D 127.0.0.1:1080 fl-vps" > "$SSH_PROXY_PID_FILE"
|
||||
notify-send "SSH Proxy" "SOCKS5 запущен на 1080" -i network-vpn
|
||||
}
|
||||
|
||||
sshp-stop() {
|
||||
PID=$(cat "$SSH_PROXY_PID_FILE")
|
||||
kill "$PID" && rm -f "$SSH_PROXY_PID_FILE"
|
||||
notify-send "SSH Proxy" "Прокси остановлен" -i network-disconnect
|
||||
}
|
||||
|
||||
# Логика тумблера
|
||||
if sshp-status-check; then
|
||||
sshp-stop
|
||||
else
|
||||
sshp-start
|
||||
fi
|
||||
Reference in New Issue
Block a user