add git wg update
This commit is contained in:
12
git-wg-update
Executable file
12
git-wg-update
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
KEY=$1
|
||||
NETWORK=${2:-${PWD##*/}}
|
||||
mapfile -t LINES <<< "$(sudo wg show $NETWORK $KEY)"
|
||||
|
||||
for i in "${LINES[@]}"; do
|
||||
if [ -n "$i" ]; then
|
||||
PEER=$(echo $i | awk -F ' ' '{print $1}')
|
||||
VALUE=$(echo $i | awk -F ' ' '{$1="";print $0}')
|
||||
git-wg-peer-update "$PEER" "$KEY" "$VALUE"
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user