New backup 2025-08-31 14:15:01
This commit is contained in:
parent
abc99e0205
commit
5bf45f3fc9
1 changed files with 15 additions and 4 deletions
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
|
|
||||||
function ifstatus(){
|
function ifstatus(){
|
||||||
|
is_online=false
|
||||||
is_wireless=false
|
is_wireless=false
|
||||||
is_ethernet=false
|
is_ethernet=false
|
||||||
|
is_vpn=false
|
||||||
is_proton=false
|
is_proton=false
|
||||||
is_proton_sc=false
|
is_proton_sc=false
|
||||||
is_homevpn=false
|
is_homevpn=false
|
||||||
|
@ -18,11 +20,20 @@ function ifstatus(){
|
||||||
vpn_cons=$(nmcli -g TYPE,NAME connection show --active | grep -e "vpn" -e "wireguard")
|
vpn_cons=$(nmcli -g TYPE,NAME connection show --active | grep -e "vpn" -e "wireguard")
|
||||||
|
|
||||||
case ${vpn_cons} in
|
case ${vpn_cons} in
|
||||||
*ProtonVPN)
|
*ProtonVPN|*'ProtonVPN\n')
|
||||||
is_proton='true'
|
is_proton='true'
|
||||||
;;
|
;;&
|
||||||
*ProtonVPN-SC)
|
*ProtonVPN-SC|*'ProtonVPN-SC\n')
|
||||||
is_proton_sc='true'
|
is_proton_sc='true'
|
||||||
|
;;&
|
||||||
|
*HomeVPN)
|
||||||
|
is_homevpn='true'
|
||||||
|
;;&
|
||||||
|
*HomeVPN-Full)
|
||||||
|
is_homevpn_full='true'
|
||||||
|
;;&
|
||||||
|
*ProtonVPN|*ProtonVPN-SC|*HomeVPN|*HomeVPN-Full)
|
||||||
|
is_vpn='true'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
# if grep -qe "ProtonVPN$" <<<${vpn_cons};then
|
# if grep -qe "ProtonVPN$" <<<${vpn_cons};then
|
||||||
|
@ -37,7 +48,7 @@ function ifstatus(){
|
||||||
# if grep -qe "HomeVPN-Full$" <<<${vpn_cons};then
|
# if grep -qe "HomeVPN-Full$" <<<${vpn_cons};then
|
||||||
# is_homevpn_full='true'
|
# is_homevpn_full='true'
|
||||||
# fi
|
# fi
|
||||||
echo $(jq -n --arg wifi "${is_wireless}" --arg wired "${is_ethernet}" --arg proton "${is_proton}" --arg proton_sc "${is_proton_sc}" --arg homevpn "${is_homevpn}" --arg homevpn_full "${is_homevpn_full}" '{wifi: $wifi, wired: $wired, proton: $proton, proton_sc: $proton_sc, homevpn: $homevpn, homevpn_full: $homevpn_full}')
|
echo $(jq -n --arg online "${is_online}" --arg wifi "${is_wireless}" --arg wired "${is_ethernet}" --arg vpn "${is_vpn}" --arg proton "${is_proton}" --arg proton_sc "${is_proton_sc}" --arg homevpn "${is_homevpn}" --arg homevpn_full "${is_homevpn_full}" '{online: $online, wifi: $wifi, wired: $wired, vpn: $vpn, proton: $proton, proton_sc: $proton_sc, homevpn: $homevpn, homevpn_full: $homevpn_full}')
|
||||||
}
|
}
|
||||||
|
|
||||||
ifstatus
|
ifstatus
|
||||||
|
|
Loading…
Add table
Reference in a new issue