2022-08-19 13:50:18 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
run_directory=$(dirname "$0")
|
|
|
|
user=$(whoami)
|
|
|
|
|
|
|
|
if [ -f $run_directory/.disabled ]; then
|
|
|
|
echo "Installation is disabled. Exiting..."
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $user != 'root' ]]; then
|
|
|
|
sudo="sudo"
|
|
|
|
else
|
|
|
|
sudo=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Copying WebSSH unit to system directory..."
|
|
|
|
$sudo cp systemd-templates/boot-sms.service /etc/systemd/system/
|
2022-08-28 12:54:43 +02:00
|
|
|
$sudo sed -i -e "s:PH_DIRECTORY:$run_directory:g" /etc/systemd/system/boot-sms.service
|
2022-08-19 13:50:18 +02:00
|
|
|
|
|
|
|
echo "Reloading Systemd..."
|
|
|
|
$sudo systemctl daemon-reload
|
|
|
|
|
|
|
|
echo "Enabling boot-sms.service..."
|
|
|
|
$sudo systemctl enable boot-sms.service
|
|
|
|
|
|
|
|
echo "Finished install. Exiting..."
|
|
|
|
exit 0
|