add wg.sh

This commit is contained in:
meml0rz
2024-11-01 03:36:47 +01:00
parent 45e187f8fa
commit f1db607cac
2 changed files with 11 additions and 0 deletions

10
components/wg.sh Normal file
View File

@ -0,0 +1,10 @@
response=$(curl -s https://am.i.mullvad.net/json)
if [ $? -ne 0 ]; then
exit 1
fi
server=$(echo "$response" | jq -r '.mullvad_exit_ip_hostname')
if [ "$server" != "null" ]; then
echo "$server"
else
echo "NULL"
fi

View File

@ -10,6 +10,7 @@ static const struct arg args[] = {
{ netspeed_rx, " [ %sB/s]", IFACE },
{ netspeed_tx, " [ %sB/s]", IFACE },
{ ipv4, " ^c#fb4934^[ %s]", IFACE },
{ run_command, " ^c#fb4934^[%s]", "sh /opt/suckless/slstatus/components/wg.sh" },
//{ mullvad_stat, " [VPN: %s]", NULL},
//{ battery_perc, " ^c#fe9019^[ %s%%", BAT },