2023-06-03 12:33:17 +02:00
|
|
|
#!/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..."
|
2023-06-03 18:14:39 +02:00
|
|
|
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
|
|
|
|
cp $run_directory/systemd-templates/set-ip-routes.path /storage/.config/system.d/
|
2023-06-03 12:33:17 +02:00
|
|
|
|
|
|
|
echo "Reloading Systemd..."
|
2023-06-03 12:59:35 +02:00
|
|
|
systemctl daemon-reload
|
2023-06-03 12:54:27 +02:00
|
|
|
echo "Enabling path unit (not starting it, either do it manually or reboot)..."
|
2023-06-03 12:59:35 +02:00
|
|
|
systemctl enable set-ip-routes.path
|
2023-06-03 12:33:17 +02:00
|
|
|
|
|
|
|
echo "Finished install. Exiting..."
|
|
|
|
exit 0
|