kleiner verbesserungen

This commit is contained in:
Désiré Werner Menrath 2023-11-14 20:03:48 +01:00
parent 19aa3c3a42
commit 6032decfbe

25
wire_g
View File

@ -116,17 +116,17 @@ remove(){
ACTIVE=$(cat ${WG_WDIR}.wg_noactive.txt)
nmcli connection delete $SELECTION &> ${WG_WDIR}.tmp.txt
if success=$(grep -i 'erfolgreich gelöscht\|successfully deleted' ${WG_WDIR}.tmp.txt)
if SUCCESS=$(grep -i 'erfolgreich gelöscht\|successfully deleted' ${WG_WDIR}.tmp.txt)
then
yad --window-icon=${WG_PIC}wg-trash.png \
--image-on-top --image=${WG_PIC}wg-info.png \
--text=$"Your TUNNEL $SELECTION was successfully deleted." \
--text=$"Your Tunnel $SELECTION was successfully deleted." \
--text-align=center --button=$"OK" --title "Wire-G Trash" \
--center --buttons-layout=center --borders=8
else
yad --window-icon=${WG_PIC}wg-trash.png \
--image-on-top --image=${WG_PIC}wg-info.png \
--text=$"Oh something went wrong.\nPlease delete TUNNEL in the network manager." \
--text=$"Oh something went wrong.\nPlease delete Tunnel in the network manager." \
--text-align=center --button=$"OK" --title "Wire-G Trash" \
--center --buttons-layout=center --borders=8
fi
@ -136,7 +136,6 @@ remove(){
pkill yad
fi }
# function end
############################################################################################################
############################################################################################################
@ -149,7 +148,7 @@ up_or_down(){
if [[ -z $ACTIVE ]]
then
yad --image-on-top --image=${WG_PIC}wg-info.png \
--text=$"\There is no active TUNNEL that you could stop." \
--text=$"\There is no active Tunnel that you could stop." \
--text-align=center --no-buttons --title "Wire-G" \
--borders=8 --undecorated \
--timeout 4 --timeout-indicator=bottom --skip-taskbar
@ -167,8 +166,6 @@ export -f up_or_down
about(){
WG_PIC="/home/$USER/.icons/"
VERSION=3.1.5
yad --title="Wire-G" --center \
--borders=8 --buttons-layout=center --text-align=center \
--button=$"OK" --undecorated \
@ -182,7 +179,6 @@ about(){
<a href='https://git.lunix.dedyn.io/punix/Wire-G'>Download Wire-G </a> \n"
}
export -f about
# function end
############################################################################################################
@ -210,7 +206,7 @@ SELECTION=$(yad --no-klick --list --center \
--button=$"Start:0" --button=$"Stop":"bash -c up_or_down" \
--button=$"Import":"bash -c import_wg" \
--button=$"Remove:4" --separator="" \
--button=$"About":"bash -c about" \
--button=$"About:5" \
--window-icon=${WG_PIC}wg-vpn.png \
--borders=8 --image-on-top --image=${WG_PIC}wg-active.png \
--column=$"Selection" $TUNNEL \
@ -218,16 +214,21 @@ SELECTION=$(yad --no-klick --list --center \
<b>----------------------------------------------------------------------------------</b>
<b>If no Tunnels are listed,</b>
<b>so they have to import their Tunnel beforehand.</b>")
ret=$?
RET=$?
[[ $? -eq 1 ]] && exit 0
if [[ $ret -eq 4 ]]
if [[ $RET -eq 4 ]]
then
remove
fi
if [[ $ret -eq 0 ]]
if [[ $RET -eq 5 ]]
then
remove
fi
if [[ $RET -eq 0 ]]
then
if [[ -n $ACTIVE ]]
then