From 73917c0f887c183aa710f76b28170508b2b66f83 Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Sat, 6 May 2023 09:41:10 -0700 Subject: [PATCH] Add systemd unit file --- adsms.service | 17 +++++++++++++++++ installer.sh | 4 ++++ 2 files changed, 21 insertions(+) create mode 100644 adsms.service diff --git a/adsms.service b/adsms.service new file mode 100644 index 0000000..006f07f --- /dev/null +++ b/adsms.service @@ -0,0 +1,17 @@ +# Systemd unit file for the adsms service +# Generated by ChatGPT + +[Unit] +Description=Send SMS notifications based on ADS-B data +After=network.target +Requires=tar1090.service +After=tar1090.service + +[Service] +User=adsms +Group=adsms +ExecStart=/usr/local/bin/adsms /etc/adsms.json +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/installer.sh b/installer.sh index a137c2b..e442e2e 100755 --- a/installer.sh +++ b/installer.sh @@ -22,3 +22,7 @@ chmod 640 /etc/adsms.json cp -f adsms.py /usr/local/bin/adsms chown root:root /usr/local/bin/adsms chmod 755 /usr/local/bin/adsms + +cp adsms.service /etc/systemd/system/ +chown root:root /etc/systemd/system/adsms.service +chmod 644 /etc/systemd/system/adsms.service