From 2ef17f736650a788dfb418dcd7c64dc87c8810db Mon Sep 17 00:00:00 2001 From: punix Date: Wed, 8 Nov 2023 16:51:29 +0100 Subject: [PATCH] test3 import ohne else --- wire_g | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) 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