#!/bin/bash install_user=$(1 backupzip=$date-pivpnbackup.tgz tar -czf $backupzip -C ${install_home} $backupdir 2&>1 echo -e "Backup crated to $install_home/$backupdir/$backupzip \nTo restore the backup, follow instructions at:\nhttps://github.com/pivpn/pivpn/wiki/FAQ#how-can-i-migrate-my-configs-to-another-pivpn-instance" } if [[ ! $EUID -eq 0 ]];then if [[ $(dpkg-query -s sudo) ]];then export SUDO="sudo" else echo "::: Please install sudo or run this as root." exit 0 fi fi backup_openvpn