fehler in wg_stop gefixt und import test5
This commit is contained in:
parent
0e9d72be8e
commit
337d5abc7d
2
wg_stop
2
wg_stop
@ -23,6 +23,8 @@ export textdomaindir="/usr/share/locale"
|
|||||||
a_user=$(whoami)
|
a_user=$(whoami)
|
||||||
wg_wdir="/home/$a_user/.config/wg_nmcli/"
|
wg_wdir="/home/$a_user/.config/wg_nmcli/"
|
||||||
wg_pic="/home/$a_user/.icons/"
|
wg_pic="/home/$a_user/.icons/"
|
||||||
|
#Dieser befehl ist notwendig da nach dem import (erster Start) gestartete Tunnel nicht in der .tunnel Datei stehen.
|
||||||
|
nmcli connection show | grep -iPo "(.*)(wireguard)" | sed 's/ .*//' > ${wg_wdir}.tunnel.txt
|
||||||
#Damit wird der inhalt von /home/$a_user/.config/wg_nmcli/.tunnel.txt in ein Array gespeichert
|
#Damit wird der inhalt von /home/$a_user/.config/wg_nmcli/.tunnel.txt in ein Array gespeichert
|
||||||
IFS=$'\n' lines=( $(cat ${wg_wdir}.tunnel.txt) )
|
IFS=$'\n' lines=( $(cat ${wg_wdir}.tunnel.txt) )
|
||||||
#echo ${lines[0]} #Damit wird der Inhalt ausgelesen. (Index angeben)
|
#echo ${lines[0]} #Damit wird der Inhalt ausgelesen. (Index angeben)
|
||||||
|
5
wire_g
5
wire_g
@ -89,7 +89,7 @@ import_wg(){
|
|||||||
wg_stop
|
wg_stop
|
||||||
nmcli connection import type wireguard file $wgconf &> ${wg_wdir}.tmp.txt
|
nmcli connection import type wireguard file $wgconf &> ${wg_wdir}.tmp.txt
|
||||||
wg_notify
|
wg_notify
|
||||||
|
|
||||||
else
|
else
|
||||||
nmcli connection import type wireguard file $wgconf &> ${wg_wdir}.tmp.txt
|
nmcli connection import type wireguard file $wgconf &> ${wg_wdir}.tmp.txt
|
||||||
wg_notify
|
wg_notify
|
||||||
@ -102,7 +102,8 @@ import_wg(){
|
|||||||
--fixed --center --buttons-layout=center --borders=8 \
|
--fixed --center --buttons-layout=center --borders=8 \
|
||||||
--text $"<b>Oh, something went wrong.</b> \n
|
--text $"<b>Oh, something went wrong.</b> \n
|
||||||
<b>No valid Wireguard file.</b> \n
|
<b>No valid Wireguard file.</b> \n
|
||||||
<b>Here is an example:</b><span color='#0fad0a'><b> my_wireguard.conf</b></span> \n" ;;
|
<b>Here is an example:</b><span color='#0fad0a'><b> my_wireguard.conf</b></span> \n"
|
||||||
|
more ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
export -f import_wg
|
export -f import_wg
|
||||||
|
Loading…
Reference in New Issue
Block a user