29 lines
605 B
Bash
29 lines
605 B
Bash
|
#!/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/
|
||
|
$sudo sed -i -e "s:PH_DIRECTORY:$(pwd):g" /etc/systemd/system/boot-sms.service
|
||
|
|
||
|
echo "Reloading Systemd..."
|
||
|
$sudo systemctl daemon-reload
|
||
|
|
||
|
echo "Enabling boot-sms.service..."
|
||
|
$sudo systemctl enable boot-sms.service
|
||
|
|
||
|
echo "Finished install. Exiting..."
|
||
|
exit 0
|