Update restore procedure
This commit is contained in:
parent
c08286273b
commit
e5ce4acb6a
@ -1,7 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# The parameter $1 is the backup directory location
|
|
||||||
# which will be compressed afterward
|
|
||||||
backup_dir="${1}/apps/vpnclient"
|
backup_dir="${1}/apps/vpnclient"
|
||||||
mkdir -p "${backup_dir}/"
|
mkdir -p "${backup_dir}/"
|
||||||
|
|
||||||
|
@ -25,15 +25,13 @@ domain=${1}
|
|||||||
url_path=${2}
|
url_path=${2}
|
||||||
|
|
||||||
if ! $upgrade; then
|
if ! $upgrade; then
|
||||||
|
|
||||||
source ./prerequisites
|
source ./prerequisites
|
||||||
|
fi
|
||||||
|
|
||||||
# Check domain/path availability
|
# Check domain/path availability
|
||||||
sudo yunohost app checkurl ${domain}${url_path} -a vpnclient
|
sudo yunohost app checkurl ${domain}${url_path} -a vpnclient
|
||||||
if [ ! $? -eq 0 ]; then
|
if [ ! $? -eq 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install packages
|
# Install packages
|
||||||
@ -63,10 +61,6 @@ if ! $upgrade; then
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Save git commit
|
|
||||||
gitcommit=$(git rev-parse HEAD)
|
|
||||||
sudo yunohost app setting vpnclient gitcommit -v "${gitcommit}"
|
|
||||||
|
|
||||||
# Install IPv6 scripts
|
# Install IPv6 scripts
|
||||||
sudo install -o root -g root -m 0755 ../conf/ipv6_expanded /usr/local/bin/
|
sudo install -o root -g root -m 0755 ../conf/ipv6_expanded /usr/local/bin/
|
||||||
sudo install -o root -g root -m 0755 ../conf/ipv6_compressed /usr/local/bin/
|
sudo install -o root -g root -m 0755 ../conf/ipv6_compressed /usr/local/bin/
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# The parameter $1 is the uncompressed restore directory location
|
|
||||||
backup_dir="${1}/apps/vpnclient"
|
backup_dir="${1}/apps/vpnclient"
|
||||||
|
|
||||||
mkdir -p /etc/openvpn/
|
mkdir -p /etc/openvpn/
|
||||||
cp -a "${backup_dir}/keys/" /etc/openvpn/
|
cp -a "${backup_dir}/keys/" /etc/openvpn/
|
||||||
|
|
||||||
gitcommit=$(sudo yunohost app setting vpnclient gitcommit)
|
gitcommit=$(grep revision /etc/yunohost/apps/vpnclient/status.json | sed 's/.*"revision": "\([^"]\+\)".*/\1/')
|
||||||
tmpdir=$(mktemp -dp /tmp/ vpnclient-restore-XXXXX)
|
tmpdir=$(mktemp -dp /tmp/ vpnclient-restore-XXXXX)
|
||||||
|
|
||||||
git clone https://github.com/labriqueinternet/vpnclient_ynh.git "${tmpdir}/"
|
git clone https://github.com/labriqueinternet/vpnclient_ynh.git "${tmpdir}/"
|
||||||
|
@ -21,14 +21,10 @@ export VPNCLIENT_UPGRADE=1
|
|||||||
sudo bash /etc/yunohost/apps/vpnclient/scripts/remove &> /dev/null
|
sudo bash /etc/yunohost/apps/vpnclient/scripts/remove &> /dev/null
|
||||||
bash ./install "${domain}" "${path}" "${server_name}"
|
bash ./install "${domain}" "${path}" "${server_name}"
|
||||||
|
|
||||||
gitcommit=$(ynh_setting vpnclient gitcommit)
|
|
||||||
|
|
||||||
sudo cp -a "${tmpdir}/settings.yml" /etc/yunohost/apps/vpnclient/
|
sudo cp -a "${tmpdir}/settings.yml" /etc/yunohost/apps/vpnclient/
|
||||||
sudo cp -a "${tmpdir}/keys/"* /etc/openvpn/keys/ 2> /dev/null
|
sudo cp -a "${tmpdir}/keys/"* /etc/openvpn/keys/ 2> /dev/null
|
||||||
sudo rm -r "${tmpdir}/"
|
sudo rm -r "${tmpdir}/"
|
||||||
|
|
||||||
sudo yunohost app setting vpnclient gitcommit -v "${gitcommit}"
|
|
||||||
|
|
||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
if [ -z "$(ynh_setting vpnclient dns0)" ]; then
|
if [ -z "$(ynh_setting vpnclient dns0)" ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user