✏️ Slightly cleaner script
This commit is contained in:
parent
06942af2c5
commit
190d6ee55a
1 changed files with 11 additions and 6 deletions
11
scripts/rt
11
scripts/rt
|
|
@ -1,8 +1,13 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if pgrep -x "openvpn" >/dev/null; then
|
main() {
|
||||||
|
if pgrep -x "openvpn" >/dev/null; then
|
||||||
IPV4=$(ip addr show dev tun0 | grep inet | awk '{print $2}' | cut -d/ -f1 | head -n 1)
|
IPV4=$(ip addr show dev tun0 | grep inet | awk '{print $2}' | cut -d/ -f1 | head -n 1)
|
||||||
/usr/bin/rtorrent -b "$IPV4"
|
/usr/bin/rtorrent -b "$IPV4"
|
||||||
else
|
else
|
||||||
echo "openvpn is not running. please start your VPN first."
|
echo "openvpn is not running. please start your VPN first."
|
||||||
fi
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue