114
114
# Remove lines from cupsd.conf which got obsolete in CUPS 1.6.x and would
115
115
# prevent the CUPS daemon from starting due to being invalid now.
116
cat /etc/cups/cupsd.conf | grep -Eiv '^\s*Browse(Order|Allow|Deny|Poll|RemoteProtocols)' > /etc/cups/cupsd.conf.new
117
if [ -r /etc/cups/cupsd.conf.new ]; then
118
if ! diff -q /etc/cups/cupsd.conf /etc/cups/cupsd.conf.new > /dev/null 2>&1; then
119
mv -f /etc/cups/cupsd.conf.new /etc/cups/cupsd.conf
121
rm /etc/cups/cupsd.conf.new
116
if dpkg --compare-versions "$2" le "1.6.4"; then
117
# Backup pre-1.6 cupsd.conf for cups-browsed upgrade path
118
cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.pre16-bak
120
cat /etc/cups/cupsd.conf | grep -Eiv '^\s*Browse(Order|Allow|Deny|Poll|RemoteProtocols)' > /etc/cups/cupsd.conf.new
121
if [ -r /etc/cups/cupsd.conf.new ]; then
122
if ! diff -q /etc/cups/cupsd.conf /etc/cups/cupsd.conf.new > /dev/null 2>&1; then
123
mv -f /etc/cups/cupsd.conf.new /etc/cups/cupsd.conf
125
rm /etc/cups/cupsd.conf.new
128
# Also the argument "cups" for BrowseLocalProtocols is obsolete. Remove the
129
# argument and put "dnssd" if there are no arguments left.
130
cat /etc/cups/cupsd.conf | perl -p -e 's/^(\s*BrowseLocalProtocols.*?)\s+cups/$1/i; s/^(\s*BrowseLocalProtocols)(\s*)$/$1 dnssd$2/i' > /etc/cups/cupsd.conf.new
131
if [ -r /etc/cups/cupsd.conf.new ]; then
132
if ! diff -q /etc/cups/cupsd.conf /etc/cups/cupsd.conf.new > /dev/null 2>&1; then
133
mv -f /etc/cups/cupsd.conf.new /etc/cups/cupsd.conf
135
rm /etc/cups/cupsd.conf.new
124
# Also the argument "cups" for BrowseLocalProtocols is obsolete. Remove the
125
# argument and put "dnssd" if there are no arguments left.
126
cat /etc/cups/cupsd.conf | perl -p -e 's/^(\s*BrowseLocalProtocols.*?)\s+cups/$1/i; s/^(\s*BrowseLocalProtocols)(\s*)$/$1 dnssd$2/i' > /etc/cups/cupsd.conf.new
127
if [ -r /etc/cups/cupsd.conf.new ]; then
128
if ! diff -q /etc/cups/cupsd.conf /etc/cups/cupsd.conf.new > /dev/null 2>&1; then
129
mv -f /etc/cups/cupsd.conf.new /etc/cups/cupsd.conf
131
rm /etc/cups/cupsd.conf.new