Compare commits
5 Commits
11cafd2116
...
5748696970
Author | SHA1 | Date | |
---|---|---|---|
5748696970 | |||
f2e0a81311 | |||
5bf57f07cc | |||
c98a873aad | |||
96256a3636 |
17
adsms.service
Normal file
17
adsms.service
Normal file
|
@ -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/bin/adsms /etc/adsms.json
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
10
build.sh
10
build.sh
|
@ -1,10 +0,0 @@
|
|||
#!/bin/sh
|
||||
rm -rf dist/*
|
||||
python3 -m build
|
||||
cd dist/
|
||||
tar zxf *.tar.gz
|
||||
directory=$(ls | grep -v .tar.gz | grep -v whl)
|
||||
rm $directory.tar.gz
|
||||
cp --recursive ../debian/ $directory
|
||||
tar czf $directory.tar.gz $directory
|
||||
rm -r $directory
|
4
debian/control
vendored
4
debian/control
vendored
|
@ -10,8 +10,8 @@ Vcs-Git: https://git.kj7rrv.com/kj7rrv/adsms.git
|
|||
Rules-Requires-Root: no
|
||||
|
||||
Package: adsms
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Architecture: all
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, python3, python3-requests
|
||||
Description: Send SMS messages based on ADS-B data
|
||||
adsms sends SMS notifications whenever particular aircraft are detected by a
|
||||
local readsb installation. It uses a configurable set of rules to determine
|
||||
|
|
13
debian/postinst.ex → debian/postinst
vendored
13
debian/postinst.ex → debian/postinst
vendored
|
@ -31,6 +31,19 @@ case "$1" in
|
|||
;;
|
||||
esac
|
||||
|
||||
adduser --system --group --no-create-home --home=/var/lib/adsms --quiet adsms
|
||||
|
||||
mkdir -p /var/lib/adsms
|
||||
chown adsms:adsms /var/lib/adsms
|
||||
chmod 775 /var/lib/adsms
|
||||
|
||||
touch /var/lib/adsms/subscribers.db
|
||||
chown adsms:adsms /var/lib/adsms/subscribers.db
|
||||
chmod 660 /var/lib/adsms/subscribers.db
|
||||
|
||||
chmod 640 /etc/adsms.json
|
||||
|
||||
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
28
installer.sh
28
installer.sh
|
@ -1,28 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo "This script must be run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
useradd --system --shell /bin/false --home /var/lib/adsms adsms
|
||||
|
||||
mkdir -p /var/lib/adsms
|
||||
chown adsms:adsms /var/lib/adsms
|
||||
chmod 775 /var/lib/adsms
|
||||
|
||||
touch /var/lib/adsms/subscribers.db
|
||||
chown adsms:adsms /var/lib/adsms/subscribers.db
|
||||
chmod 660 /var/lib/adsms/subscribers.db
|
||||
|
||||
cp -n example_config.json /etc/adsms.json
|
||||
chown root:adsms /etc/adsms.json
|
||||
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
|
|
@ -8,3 +8,5 @@ py.install_sources(
|
|||
)
|
||||
|
||||
install_data('run_adsms.py', install_dir: get_option('bindir'), rename: 'adsms')
|
||||
install_data('adsms.service', install_dir: 'lib/systemd/system')
|
||||
install_data('example_config.json', install_dir: 'etc', rename: 'adsms.json')
|
||||
|
|
Loading…
Reference in New Issue
Block a user