diff --git a/build.sh b/build.sh deleted file mode 100644 index 32a64be..0000000 --- a/build.sh +++ /dev/null @@ -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 diff --git a/debian/postinst b/debian/postinst index dd9254b..be2e240 100644 --- a/debian/postinst +++ b/debian/postinst @@ -33,6 +33,17 @@ 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. diff --git a/installer.sh b/installer.sh deleted file mode 100755 index e442e2e..0000000 --- a/installer.sh +++ /dev/null @@ -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 diff --git a/meson.build b/meson.build index da5dd24..48dc71e 100644 --- a/meson.build +++ b/meson.build @@ -9,3 +9,4 @@ 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')