remove-neu

This commit is contained in:
Désiré Werner Menrath 2023-11-05 11:07:20 +01:00
parent 352ab6cfb0
commit d980a099de

18
wire_g
View File

@ -106,12 +106,18 @@ remove(){
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 --height=300 --width=60 \
--title="Wire-G Trash" --center \
--fixed --buttons-layout=center \
--button=$"OK" --button=$"Cancel" \
--separator="" --window-icon=${wg_pic}wg-trash.png \
--borders=8 --column=$"Delete" $tunnel)
if selection=$(yad --no-click --list --center \
--window-icon=${wg_pic}wg-trash.png \
--height=300 --width=60 --title="Wire-G Trash" \
--fixed --buttons-layout=center --separator="" \
--button=$"OK" --button=$"Cancel" \
--borders=8 --image-on-top --image=${wg_pic}wg-active.png \
--column=$"Delete" $tunnel \
--text=$"<b>Activ Tunnel: </b> <span color='#0fad0a'><b>$active</b></span>
<b>----------------------------------------------------------------------------------</b>
<b>If no tunnels are listed,</b>
<b>so they have to import their tunnel beforehand.</b>")
then
nmcli connection delete $selection &> ${wg_wdir}.tmp.txt
success=$(grep -i 'erfolgreich gelöscht\|successfully deleted' ${wg_wdir}.tmp.txt)