#!/usr/bin/env bash run_directory=$(dirname $(readlink -f "$0")) source "$run_directory/variables.conf" if [ -f $run_directory/.disabled ]; then echo "Installation is disabled. Exiting..." exit 0 fi echo "Copying Systemd units to system directory..." cp $run_directory/systemd-templates/set-ip-routes.service /storage/.config/system.d/ sed -i -e "s/PH_DNS/$dns_server/g" /storage/.config/system.d/set-ip-routes.service sed -i -e "s:PH_NETWORK:$target_network:g" /storage/.config/system.d/set-ip-routes.service mkdir /storage/.config/system.d/sys-subsystem-net-devices-wg0.device.d cp $run_directory/systemd-templates/set-ip-routes.conf /storage/.config/system.d/sys-subsystem-net-devices-wg0.device.d echo "Reloading Systemd..." systemctl daemon-reload echo "Finished install. Exiting..." exit 0