summarylogtreecommitdiffstats
path: root/roger-router.install
blob: 4f5bca9dae2be6bc422167c7f79a7daed7f42050 (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() {
	if [ ! -d "$pkgdir/var/spool/roger" ]; then
		mkdir -p "$pkgdir/var/spool/roger"
		chmod 2770 "$pkgdir/var/spool/roger"
		chown root:lp "$pkgdir/var/spool/roger"
	fi

	if [ ! "$(lpstat -s | grep 'socket://localhost' | grep -i 'roger')" ]; then
		lpadmin -p Roger-Router-Fax -m drv:///sample.drv/generic.ppd -v socket://localhost:9100/ -E -o PageSize=A4 || 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"
		echo
		gpasswd --add $(logname) lp || echo "Add a user to the group \"lp\" with: gpasswd --add $(logname) 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 your DECT phone"
	echo "==> To deactivate a CAPI over TCP, please call #96*2* from your DECT phone"
	echo
	echo "==> To activate a signaling of calls: Please call #96*5*"
	echo "==> To deactivate a signaling of calls: Please call #96*4*"
}

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

post_upgrade() {
	post_install
}