Start systemd services automatically

Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
This commit is contained in:
Juhyung Park
2024-10-17 12:59:49 +09:00
parent 90f3a53f7c
commit 5da9b76577
2 changed files with 12 additions and 16 deletions

View File

@@ -24,8 +24,17 @@ if [[ "$USER" != "immich" ]]; then
mkdir -p /var/log/immich
chown immich:immich /var/log/immich
echo "Restarting the script as user immich"
exec sudo -u immich $0 $*
echo "Forking the script as user immich"
sudo -u immich $0 $*
echo "Starting systemd services"
cp immich*.service /etc/systemd/system/
systemctl daemon-reload
for i in immich*.service; do
systemctl enable $i
systemctl start $i
done
exit 0
fi
BASEDIR=$(dirname "$0")
@@ -166,5 +175,5 @@ EOF
rm -rf $TMP
echo
echo "Done. Please install the systemd services to start using Immich."
echo "Done."
echo