test mit export für entfernen
This commit is contained in:
parent
4452bc73a0
commit
363894584d
29
wire_g
29
wire_g
@ -114,9 +114,7 @@ import_wg(){
|
||||
<b>Here is an example:</b><span color='#0fad0a'><b> my_wireguard.conf</b></span> \n"
|
||||
import_wg ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
}
|
||||
fi }
|
||||
export -f import_wg
|
||||
|
||||
# function end
|
||||
@ -132,19 +130,6 @@ 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 --center \
|
||||
--window-icon=${wg_pic}wg-trash.png \
|
||||
--height=300 --width=60 --title="Wire-G Trash" \
|
||||
--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
|
||||
if success=$(grep -i 'erfolgreich gelöscht\|successfully deleted' ${wg_wdir}.tmp.txt)
|
||||
then
|
||||
@ -164,7 +149,6 @@ remove(){
|
||||
then
|
||||
pkill wire_g
|
||||
pkill yad
|
||||
fi
|
||||
fi }
|
||||
export -f remove
|
||||
|
||||
@ -231,12 +215,12 @@ connect(){
|
||||
############################################################################################################ # --text "<b>Aktiver Tunnel:</b> <span color='#0fad0a'><b>$active</b></span> # mit <b>gewünschtes wort</b> wird fett geschrieben.
|
||||
# Farbe für Variable $active festgelegt mit fetter Schrift. (bei --text zwischen " ")
|
||||
|
||||
if selection=$(yad --no-click --list \
|
||||
--center \
|
||||
if selection=$(yad --list --center \
|
||||
--height=300 --width=60 --title="Wire-G" \
|
||||
--buttons-layout=center \
|
||||
--button=$"Start:0" --button=$"Stop":"bash -c up_or_down" \
|
||||
--button=$"Import":"bash -c import_wg" --button=$"Remove":"bash -c remove" --separator="" \
|
||||
--button=$"OK" --button=$"Stop":"bash -c up_or_down" \
|
||||
--button=$"Import":"bash -c import_wg" \
|
||||
--button=$"Remove":"bash -c remove" --separator="" \
|
||||
--button=$"About":"bash -c about" \
|
||||
--window-icon=${wg_pic}wg-vpn.png \
|
||||
--borders=8 --image-on-top --image=${wg_pic}wg-active.png \
|
||||
@ -245,9 +229,8 @@ if selection=$(yad --no-click --list \
|
||||
<b>----------------------------------------------------------------------------------</b>
|
||||
<b>If no tunnels are listed,</b>
|
||||
<b>so they have to import their tunnel beforehand.</b>")
|
||||
|
||||
export selection
|
||||
then
|
||||
|
||||
if [[ -n $active ]]
|
||||
then
|
||||
wg_stop
|
||||
|
Loading…
x
Reference in New Issue
Block a user