#!/bin/sh
if ! [ "root" = "$(id -u -n)" ]; then
echo "ERROR: ${0} must be run as root!"; exit 1
fi
rm -rf /etc/openvpn/server/*
rm -rf /etc/wireguard/*
if [ -f /etc/fedora-release ]; then
dnf -y --refresh update
/usr/libexec/vpn-server-node/server-config
elif [ -f /etc/debian_version ]; then
apt update
apt -y dist-upgrade
/usr/libexec/vpn-server-node/server-config
else
echo "ERROR: OS not supported!"
exit 1
fi