libreelec-conf/install.sh

24 lines
766 B
Bash

#!/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..."
$sudo cp $run_directory/systemd-templates/set-ip-routes.service /etc/systemd/system/
$sudo sed -i -e "s/PH_DNS/$dns_server/g" /etc/systemd/system/set-ip-routes.service
$sudo sed -i -e "s:PH_NETWORK:$target_network:g" /etc/systemd/system/set-ip-routes.service
echo "Reloading Systemd..."
$sudo systemctl daemon-reload
echo "Enabling timer (not starting it, either do it manually or reboot)..." # TODO replace by new trigger
$sudo systemctl enable conf-sync.timer
echo "Finished install. Exiting..."
exit 0