summarylogtreecommitdiffstats
path: root/roger-router.install
blob: 687265b5ddb93c8dbfcbb366e6dee9ddc921dce2 (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
32
post_install() {
  if [ ! -d "/var/spool/roger" ]; then
    echo "Creating spool directory '/var/spool/roger' owned by 'root:lp' ..."
    mkdir -p "/var/spool/roger"
    chmod 2770 "/var/spool/roger"
    chown root:lp "/var/spool/roger"
  fi

  if [ ! "$(lpstat -s | grep 'socket://localhost' | grep -i 'roger')" ]; then
    echo "Add the fax printer with: 'lpadmin -p Roger-Router-Fax -m drv:///sample.drv/generic.ppd -v socket://localhost:9100/ -E -o PageSize=A4' or similar."
    echo
    echo "Add users using this printer to the group 'lp' with 'gpasswd --add <user> lp'."
  fi

  echo "==> For faxing and calling from your PC directly, you must activate a CAPI over TCP!"
  echo "==> To activate a CAPI over TCP, please call #96*3* from a phone connected to the Fritz!Box."
  echo "==> To deactivate a CAPI over TCP, please call #96*2* from a phone connected to the Fritz!Box."
  echo
  echo "==> To activate a signaling of calls: Please call #96*5* from a phone connected to the Fritz!Box."
  echo "==> To deactivate a signaling of calls: Please call #96*4* from a phone connected to the Fritz!Box."
}

post_remove() {
  rogerprinter="$(lpstat -s | grep 'socket://localhost' | grep -i 'roger' | awk '{print $3}' | tr -d ':' | xargs)"
  if [ "$rogerprinter" ]; then
    echo "Remove the fax printer with: 'lpadmin -x $rogerprinter'"
  fi
}

post_upgrade() {
  post_install
}