Add xfce4-panel-genmon-vpnip.sh script for xfce panel

This commit is contained in:
Daniel Ruiz de Alegría 2021-10-22 16:10:23 +02:00
parent a20697e1ce
commit 12afa2866a
No known key found for this signature in database
GPG Key ID: 59667A77E8BFCB6C

View File

@ -0,0 +1,11 @@
#!/bin/sh
ip="$(ip a s tun0 2>/dev/null | grep -o -P '(?<=inet )[0-9]{1,3}(\.[0-9]{1,3}){3}')"
if [ "$ip" != "" ]; then
printf "<icon>network-vpn-symbolic</icon>"
printf "<txt>${ip}</txt>"
printf "<tool>VPN IP</tool>"
else
printf "\0x0"
fi