genconfig: Backup old config file

* Backup previous config file before overwriting.
This commit is contained in:
Kyle Manna 2014-06-29 23:09:18 -07:00
parent 1aaf6a4359
commit 7b9d82630d

View File

@ -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