init commit

This commit is contained in:
2026-10-10 01:17:31 -04:00
commit 9cd45cc345
7 changed files with 227 additions and 0 deletions
Executable
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Installs scan.sh, env template, and cleanup cron. Run as root from the repo root.
# Does NOT edit /etc/scanbd/scanbd.conf: merge config/scanbd-actions.conf by hand.
set -euo pipefail
if [ "$(id -u)" -ne 0 ]; then
echo "run as root: sudo ./install.sh" >&2
exit 1
fi
HERE="$(cd "$(dirname "$0")" && pwd)"
mkdir -p /etc/scanbd/scripts /etc/scan-station \
/var/lib/scan-station/failed /var/lib/scan-station/archive
install -m 755 "$HERE/scripts/scan.sh" /etc/scanbd/scripts/scan.sh
if [ ! -f /etc/scan-station/env ]; then
install -m 640 -o root -g scanner "$HERE/config/env.example" /etc/scan-station/env
echo "created /etc/scan-station/env: edit it and set PAPERLESS_TOKEN"
else
echo "keeping existing /etc/scan-station/env"
fi
install -m 644 "$HERE/config/scan-station-cleanup.cron" /etc/cron.d/scan-station-cleanup
chown saned:scanner /var/lib/scan-station/failed /var/lib/scan-station/archive
echo "done. next: merge config/scanbd-actions.conf into /etc/scanbd/scanbd.conf, then: systemctl restart scanbd"