/usr/share/roger/install-fax.sh is in roger-router-cli 1.8.9-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | #!/bin/sh
##
# Roger Router
# Copyright (c) 2012-2014 Jan-Michael Brummer, Louis Lagendijk
#
# This file is part of Roger Router.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 only.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
##
set -x
if test $# != 0; then
echo Create the cups printer required for roger-router fax sending
echo Usage: $0
exit 1
fi
if test `id -u` != 0; then
echo Not started from user root. Cannot install printer. Use sudo $0 ?
exit 2
fi
osname=`uname -s`
if test x$osname = xDarwin; then
# Mac OSX - test if group fax exists, if not create it
found_group=$(dscl . -list /Groups | grep fax)
if test x$found_group != xfax; then
# group fax does not yet exist
# find a free group id, 501 - 1023 are local admin created group ids
for gid in {501..1023}; do
found_gid=$(dscl . -list /Groups PrimaryGroupID | awk '{print $2}'|grep $gid 2>/dev/null)
if test x$found_gid != x$gid; then
break;
fi
done
# check that we really found a free group id
if test x$found_gid = x$gid; then
echo Group fax does not exist but no free group id found, cannot continue
exit 4
fi
# found a free gid, now create the group
echo allocating groupid $gid for group fax
dscl . -create /groups/fax
dscl . -append /groups/fax gid $gid
fi
backend_uid=root
backend_gid=wheel
spooldir_uid=lp
spooldir_gid=fax
else
# On linux etc we can do a simple groupadd to add the group
groupadd -f fax
backend_uid=root
backend_gid=root
spooldir_uid=lp
spooldir_gid=fax
fi
# find cups serverbin directory for backend installation
# if cups-config can be found we use it, otherwise we try a number of locations for the backenddir
cupsconfig=$(which cups-config 2> /dev/null)
if test x$cupsconfig != x; then
cupsbackenddir=$(cups-config --serverbin)/backend
else
for bindir in /usr/lib/cups /usr/local/lib/cups /usr/libexec/cups /usr/local/libexec/cups; do
if test -d $bindir/backend; then
cupsbackenddir=$bindir/backend
break;
fi
done
fi
if ! test -d $cupsbackenddir; then
echo cannot find the cups backend directory!
exit 5
fi
# Create spooler directory
mkdir -p /var/spool/roger/
chown $spooldir_uid:$spooldir_gid /var/spool/roger
chmod 2770 /var/spool/roger/
# install the backend
cp roger-cups $cupsbackenddir
chown $backend_uid:$backend_gid $cupsbackenddir
chmod 0755 $cupsbackenddir/roger-cups
# Create the printer
lpadmin -p "Roger-Router-Fax" -E -v roger-cups:/ -P roger-fax.ppd
|