wait in RET entfernt awk mit cat ersetzt

This commit is contained in:
Désiré Werner Menrath 2023-11-18 09:52:55 +01:00
parent 7989fda162
commit bcc362c007

9
wire_g
View File

@ -63,7 +63,7 @@ wg_notify(){
# Schreib die pid von Notify in
pid=$(ps aux | grep yad | grep -v grep | awk '{print $2}')
echo $pid > ${WG_WDIR}for-kill_pid.txt
IFS=$'\n' lines=( $(awk '{print $2}' ${WG_WDIR}for-kill_pid.txt) ) # awk '{print $2}' heist, zeig mir nur die zweite Nummer an
IFS=$'\n' lines=( $(cat ${WG_WDIR}for-kill_pid.txt) )
}
@ -149,7 +149,7 @@ remove(){
if [ "$SELECTION" = "$ACTIVE" ]
then
IFS=$'\n' lines=( $(awk '{print $2}' ${WG_WDIR}for-kill_pid.txt) )
IFS=$'\n' lines=( $(cat ${WG_WDIR}for-kill_pid.txt) )
kill $lines
fi }
@ -233,21 +233,18 @@ RET=$?
if [[ $RET -eq 2 ]]
then
up_or_down
wait
wire_g
fi
if [[ $RET -eq 3 ]]
then
import_wg
wait
wire_g
fi
if [[ $RET -eq 4 ]]
then
remove
wait
wire_g
fi
@ -264,12 +261,10 @@ if [[ $RET -eq 0 ]]
wg_stop
nmcli connection up $SELECTION &> ${WG_WDIR}.tmp.txt
connect
wait
wire_g
else
nmcli connection up $SELECTION &> ${WG_WDIR}.tmp.txt
connect
wait
wire_g
fi
fi