diff --git a/wire_g b/wire_g
index d3eb445..790064d 100755
--- a/wire_g
+++ b/wire_g
@@ -91,30 +91,22 @@ import_wg(){
nmcli connection import type wireguard file $wgconf &> ${wg_wdir}.tmp.txt
wg_notify
- elif [[ -z $active ]]
- then
+ else
nmcli connection import type wireguard file $wgconf &> ${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, something went wrong. \n
-No valid Wireguard file. \n
-Here is an example: my_wireguard.conf \n"
- import_wg
fi
fi ;;
- *) 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, something went wrong. \n
+ *) 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, something went wrong. \n
No valid Wireguard file. \n
-Here is an example: my_wireguard.conf \n"
- import_wg ;;
- esac }
+Here is an example: my_wireguard.conf \n" ;;
+ esac
+import_wg
+}
export -f import_wg
# function end