test 6 import

This commit is contained in:
Désiré Werner Menrath 2023-11-08 17:53:22 +01:00
parent 337d5abc7d
commit 75f64c648e

10
wire_g
View File

@ -73,12 +73,12 @@ import_wg(){
a_user=$(whoami)
wg_pic="/home/$a_user/.icons/"
wg_wdir="/home/$a_user/.config/wg_nmcli/"
wgconf=$(yad --file --separator=" \n" \
if wgconf=$(yad --file --separator=" \n" \
--button="OK" --button=$"Cancel" \
--width=1200 --height=800 \
--window-icon=${wg_pic}wg-import.png \
--title=$"Wireguard .conf Select file")
then
case "$wgconf" in
*_*.conf) if grep -i 'PEER\|PublicKey' $wgconf > /dev/null && grep -i 'Interface\|PrivateKey' $wgconf > /dev/null
@ -103,9 +103,11 @@ import_wg(){
--text $"<b>Oh, something went wrong.</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"
more ;;
import_wg ;;
esac
}
else
exit 0
fi }
export -f import_wg
# function end