summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorpks <pks@pks.rocks>2022-11-22 22:05:29 +0100
committerpks <pks@pks.rocks>2022-11-22 22:05:29 +0100
commite95d3da991d40a0ad85ba91ad83b84a0c224b1de (patch)
tree71161190ebe2902ab64e18d1375542db076ff4b7 /scripts
parent49b5ca867d4e75d53078d872f2759b3d1beac2a4 (diff)
2022-11-22
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/install.sh b/scripts/install.sh
new file mode 100755
index 0000000..6cdce59
--- /dev/null
+++ b/scripts/install.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+pip install --prefix /usr/local -r config/requirements.txt
+sudo ln -s $(pwd)/weather-logger-receiver.yaml /etc/
+sudo ln -s $(pwd)/systemd/weather-logger-receiver.service /etc/systemd/system/
+sudo systemctl daemon-reload
+sudo ln -s $(pwd)/syslog/50weather-logger-receiver.conf /etc/rsyslog.d/
+sudo systemctl restart rsyslog
+sudo ln -s $(pwd)/logrotate/weather-logger-receiver /etc/logrotate.d/
+sudo systemctl restart logrotate
+
+sudo useradd -M -s /bin/bash -G dialout weather-logger
+
+for prefix in /run /var/log /usr/local/share; do
+ sudo mkdir -p $prefix/weather_logger
+ sudo chown -R weather-logger:weather-logger $prefix/weather_logger
+ sudo chmod -R 755 $prefix/weather_logger
+done