This repository has been archived on 2023-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
frontal-web-conf/install.sh

37 lines
1.2 KiB
Bash
Raw Permalink Normal View History

2022-05-24 11:42:45 +02:00
#!/usr/bin/env bash
run_directory=$(dirname $(readlink -f "$0"))
2022-05-24 11:42:45 +02:00
2022-08-19 20:34:00 +02:00
# WARNING Unlike our usual install scripts, this one should NEVER be run unattended;
# Make sure to create .disabled file.
2022-05-24 11:42:45 +02:00
if [ -f $run_directory/.disabled ]; then
echo "Installation is disabled. Exiting..."
exit 0
fi
if [[ $user != 'root' ]]; then
sudo="sudo"
else
sudo=""
fi
2022-05-24 11:42:45 +02:00
echo "Copying Systemd units and drop-ins to system directory..."
$sudo cp $run_directory/etc-letsencrypt.mount /etc/systemd/system/
2023-07-26 20:40:14 +02:00
if [ ! -d /etc/systemd/system/systemd-cryptsetup@lecrypt.service.d ]; then
2023-07-26 20:33:36 +02:00
$sudo mkdir /etc/systemd/system/systemd-cryptsetup@lecrypt.service.d
fi
2023-07-26 20:40:14 +02:00
$sudo cp $run_directory/timeout.conf /etc/systemd/system/systemd-cryptsetup@lecrypt.service.d/
2022-08-19 20:34:00 +02:00
if [ ! -d /etc/systemd/system/nginx.service.d ]; then
$sudo mkdir /etc/systemd/system/nginx.service.d
2022-05-24 20:34:03 +02:00
fi
$sudo cp $run_directory/wait-for-dns.conf /etc/systemd/system/nginx.service.d/
2022-05-24 11:42:45 +02:00
echo "Reloading Systemd..."
$sudo systemctl daemon-reload
2023-07-26 17:47:39 +02:00
echo "Enabling etc-letsencrypt.mount..."
$sudo systemctl enable etc-letsencrypt.mount
2023-07-26 20:33:36 +02:00
# WARNING you should enable this mount (and keep nginx.service disabled) if your volume does not unlock automatically
2022-05-24 11:42:45 +02:00
echo "Finished install. Exiting..."
exit 0