add git wg update
This commit is contained in:
13
git-wg-peer-update
Executable file
13
git-wg-peer-update
Executable 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"
|
||||
Reference in New Issue
Block a user