Commit adb95b33 authored by Rafael Monnerat's avatar Rafael Monnerat

Backup tapVPN files instead remove directly

 This preserve old tapVPN working while upgrade the packages.
parent 4a80b69b
#!/bin/sh
set -e
. /usr/share/debconf/confmodule
if [ -f /etc/openvpn/vifib.conf ]; then
cp -f /etc/openvpn/vifib.conf /etc/openvpn/vifib.backup.conf
mkdir -p /etc/openvpn/vifib-keys
cp -rf /etc/openvpn/vifib-keys /etc/openvpn/vifib-backup-keys
sed -i "s/\/etc\/openvpn\/vifib-keys/\/etc\/openvpn\/vifib-backup-keys/g" /etc/openvpn/vifib.backup.conf
fi
#DEBHELPER#
exit 0
...@@ -96,6 +96,14 @@ mkdir -p $RPM_BUILD_ROOT/opt/slapos/log ...@@ -96,6 +96,14 @@ mkdir -p $RPM_BUILD_ROOT/opt/slapos/log
/ /
%defattr(-,root,root) %defattr(-,root,root)
%pre
if [ -f /etc/openvpn/vifib.conf ]; then
cp -f /etc/openvpn/vifib.conf /etc/openvpn/vifib.backup.conf
mkdir -p /etc/openvpn/vifib-keys
cp -rf /etc/openvpn/vifib-keys /etc/openvpn/vifib-backup-keys
sed -i "s/\/etc\/openvpn\/vifib-keys/\/etc\/openvpn\/vifib-backup-keys/g" /etc/openvpn/vifib.backup.conf
fi
%post %post
echo """To generate slapos configuration run '#slapos node register'""" echo """To generate slapos configuration run '#slapos node register'"""
if [ -f /bin/systemctl ]; then if [ -f /bin/systemctl ]; then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment