summarylogtreecommitdiffstats
path: root/graywolf-aprs.install
blob: ce5cb79f387687e0a04d2094a250da333b1bf7de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
post_install() {
  systemd-sysusers
  udevadm control --reload-rules 2>/dev/null || true
  udevadm trigger --subsystem-match=hidraw 2>/dev/null || true
  systemctl daemon-reload
  echo ""
  echo "==> Graywolf installed."
  echo ""
  echo "  Enable and start the service:"
  echo "    systemctl enable --now graywolf-aprs.service"
  echo ""
  echo "  Set a web UI password:"
  echo "    sudo -u graywolf-aprs graywolf auth set-password --user admin --config /var/lib/graywolf-aprs/graywolf.db"
  echo ""
  echo "  Web UI: http://localhost:8080"
  echo ""
}

post_upgrade() {
  udevadm control --reload-rules 2>/dev/null || true
  udevadm trigger --subsystem-match=hidraw 2>/dev/null || true
  systemctl daemon-reload
  if systemctl is-active --quiet graywolf-aprs.service; then
    systemctl restart graywolf-aprs.service
  fi
}

pre_remove() {
  systemctl stop graywolf-aprs.service 2>/dev/null || true
  systemctl disable graywolf-aprs.service 2>/dev/null || true
}