test import double 2
This commit is contained in:
parent
ea08fc954e
commit
e483ddf816
17
wire_g
17
wire_g
@ -81,20 +81,18 @@ import_wg(){
|
||||
--width=1200 --height=800 --no-klick \
|
||||
--window-icon=${WG_PIC}wg-import.png \
|
||||
--title=$"Wireguard .conf Select file")
|
||||
|
||||
then
|
||||
IFS=$'\n' lines=( $(cat ${WG_WDIR}tunnel.txt) )
|
||||
#echo ${lines[0]} #Damit wird der Inhalt ausgelesen. (Index angeben)
|
||||
for WG_CONF in "${lines[@]}"
|
||||
do
|
||||
echo $WG_CONF > ${WG_WDIR}exist.txt
|
||||
if grep -f ${WG_WDIR}tunnel.txt ${WG_WDIR}exist.txt
|
||||
then
|
||||
yad --image-on-top --image=${WG_PIC}wg-info.png \
|
||||
--text=$"Tunnel already exists!" \
|
||||
--text-align=center --no-buttons \
|
||||
--text-align=center --button "OK" \
|
||||
--borders=8 --undecorated \
|
||||
--timeout 3 --timeout-indicator=bottom --skip-taskbar
|
||||
--timeout-indicator=bottom --skip-taskbar
|
||||
import_wg
|
||||
done
|
||||
else
|
||||
fi
|
||||
|
||||
case "$WG_CONF" in
|
||||
|
||||
*_*.conf) if grep -i 'PEER\|PublicKey' $WG_CONF > /dev/null && grep -i 'Interface\|PrivateKey' $WG_CONF > /dev/null
|
||||
@ -121,6 +119,7 @@ import_wg(){
|
||||
<b>Here is an example:</b><span color='#0fad0a'><b> my_wireguard.conf</b></span>"
|
||||
import_wg ;;
|
||||
esac
|
||||
|
||||
fi }
|
||||
|
||||
# function end
|
||||
|
Loading…
x
Reference in New Issue
Block a user