genconfig: Backup old config file
* Backup previous config file before overwriting.
This commit is contained in:
parent
1aaf6a4359
commit
7b9d82630d
@ -14,7 +14,14 @@ if [ -z "$cn" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat > "$OPENVPN/udp1194.conf" <<EOF
|
||||
conf=$OPENVPN/udp1194.conf
|
||||
if [ -f "$conf" ]; then
|
||||
bak=$conf.$(date +%s).bak
|
||||
echo "Backing up $conf -> $bak"
|
||||
mv "$conf" "$bak"
|
||||
fi
|
||||
|
||||
cat > "$conf" <<EOF
|
||||
server 192.168.255.0 255.255.255.0
|
||||
verb 3
|
||||
#duplicate-cn
|
||||
|
Loading…
Reference in New Issue
Block a user