diff --git a/wire_g b/wire_g
index 17967dc..2293ad7 100755
--- a/wire_g
+++ b/wire_g
@@ -79,17 +79,30 @@ import_wg(){
--width=1200 --height=800 \
--window-icon=${wg_pic}wg-import.png \
--title=$"Wireguard .conf Select file")
- then
+ case $wgconf in
+ *.conf && *_*.conf)
active=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//')
if [[ -n $active ]]
then
wg_stop
nmcli connection import type wireguard file $wgconf 2> ${wg_wdir}.tmp.txt
wg_notify
- else
+ elif [[ -z $active ]]
+ then
nmcli connection import type wireguard file $wgconf 2> ${wg_wdir}.tmp.txt
wg_notify
+ else
+ yad --text-align=center --button=$"OK" --title=$"Wireguard .conf Select file" \
+ --image-on-top --image=${wg_pic}wg-info.png \
+ --fixed --center --buttons-layout=center --borders=8 \
+ --text $"Oh da ging etwas schief! \n
+Keine gültige Wireguard Datei. \n
+Hier ein Beispiel:my_wireguard.conf \n"
+ import_wg
+
fi
+ ;;
+ esac
fi }
export -f import_wg