add git wg update

This commit is contained in:
stubbfel
2018-05-24 21:35:09 +02:00
parent dab2114009
commit bb527afd1f
3 changed files with 30 additions and 4 deletions

13
git-wg-peer-update Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
PEER=$1
KEY=$2
VALUE=$3
set -e
FNAME=$(echo $PEER.wg | sed -e 's/[^A-Za-z0-9._-]/_/g')
sed -i "s/$KEY =.*/$KEY = $VALUE/g" "$FNAME"
git add "$FNAME"
git commit -m "update $KEY of peer $PEER to $VALUE"