dotfiles/root/etc/NetworkManager/dispatcher.d/11-ssh-tunnel.sh

9 lines
206 B
Bash
Raw Normal View History

#!/bin/bash
if [[ "$2" == "up" ]] || [ "$2" == "vpn-up"]]; then
su - reekymarko -c 'ssh -f -N -R 8123:localhost:22 teapot sleep 10'
fi
if [[ "$2" == "down" ]] || [ "$2" == "vpn-up"]];then
killall ssh
fi