#!/bin/bash hvconfig_pre() { hv_useradd --system -c "Print_Service_User" -d /dev/null -g lp \ -s /bin/false lp groupadd --system -f lpadmin CONFIGURE_OPTS=" \ --libdir=/usr/lib \ --disable-systemd \ --with-rcdir=/tmp/cupsinit \ --with-system-groups=lpadmin" } hvbuild_post() { if [ -n "${CUPS_SERVER}" ]; then # Configuring for connection to a remote CUPS print server cat > /etc/cups/client.conf << "EOF" ######################################################################## # # # This is the CUPS client configuration file. This file is used to # # define client-specific parameters, such as the default server or # # default encryption settings. # # # ######################################################################## # # ServerName: the hostname of your server. By default CUPS will use the # hostname of the system or the value of the CUPS_SERVER environment # variable. ONLY ONE SERVER NAME MAY BE SPECIFIED AT A TIME. To use # more than one server you must use a local scheduler with browsing # and possibly polling. # EOF echo "ServerName ${CUPS_SERVER}" >> /etc/cups/client.conf else # Configuring for a CUPS print server sed -i -e 's@Listen localhost:631@Listen \*:631@' /etc/cups/cupsd.conf fi install -v -m740 ${SCRDIR}/bootscripts/cups /etc/rc.d/init.d # script-name start stop bootscript_add_rc3 cups 40 50 }