remove 6 test
This commit is contained in:
parent
0f339b48f5
commit
67c63633b2
15
wire_g
15
wire_g
@ -115,22 +115,10 @@ export -f import_wg
|
||||
# funktion wireguard remove
|
||||
|
||||
remove(){
|
||||
a_user=$(whoami)
|
||||
wg_pic="/home/$a_user/.icons/"
|
||||
wg_wdir="/home/$a_user/.config/wg_nmcli/"
|
||||
tunnel=$(nmcli connection show | grep -iPo "(.*)(wireguard)" | sed 's/ .*//')
|
||||
|
||||
nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//' &> ${wg_wdir}.wg_noactive.txt
|
||||
active=$(cat ${wg_wdir}.wg_noactive.txt)
|
||||
|
||||
if selection=$(yad --no-click --list --center \
|
||||
--window-icon=${wg_pic}wg-trash.png \
|
||||
--height=200 --width=60 --undecorated \
|
||||
--buttons-layout=center --separator="" \
|
||||
--button=$"OK" --button=$"Cancel" \
|
||||
--borders=8 \
|
||||
--column=$"Delete" $tunnel)
|
||||
|
||||
then
|
||||
nmcli connection delete $selection &> ${wg_wdir}.tmp.txt
|
||||
if success=$(grep -i 'erfolgreich gelöscht\|successfully deleted' ${wg_wdir}.tmp.txt)
|
||||
then
|
||||
@ -151,7 +139,6 @@ remove(){
|
||||
if [ "$selection" = "$active" ]
|
||||
then
|
||||
pkill yad
|
||||
fi
|
||||
fi }
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user