32 lines
831 B
Bash
Executable File
32 lines
831 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
run_directory=$(dirname $(readlink -f "$0"))
|
|
|
|
# WARNING Unlike our usual install scripts, this one should NEVER be run unattended;
|
|
# Make sure to create .disabled file.
|
|
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 Systemd units and drop-ins to system directory..."
|
|
$sudo cp $run_directory/etc-letsencrypt.mount /etc/systemd/system/
|
|
if [ ! -d /etc/systemd/system/nginx.service.d ]; then
|
|
$sudo mkdir /etc/systemd/system/nginx.service.d
|
|
fi
|
|
$sudo cp $run_directory/wait-for-dns.conf /etc/systemd/system/nginx.service.d/
|
|
|
|
echo "Reloading Systemd..."
|
|
$sudo systemctl daemon-reload
|
|
echo "Disabling nginx..."
|
|
$sudo systemctl disable nginx
|
|
|
|
echo "Finished install. Exiting..."
|
|
exit 0
|