home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / share / cups / browsing_status next >
Encoding:
Text File  |  2007-04-04  |  592 b   |  24 lines

  1. #!/bin/sh -e
  2.  
  3. # Author: Martin Pitt <martin.pitt@ubuntu.com>
  4. # (C) 2005  Canonical Ltd.
  5. #
  6. # Get the status of IPP network browsing through exit code:
  7. #
  8. # 0: browsing is disabled (default configuration)
  9. # 1: browsing is enabled for LAN
  10. # 2: the configuration was adapted manually; in this case enable_browsing cannot
  11. #    be used
  12.  
  13. CONF=/etc/cups/cupsd.conf
  14.  
  15. [ -f $CONF ] || exit 2
  16.  
  17. if egrep -qi '^[[:space:]]*Browsing[[:space:]]+(No|Off)[[:space:]]*(#.*)?$' $CONF; then
  18.     exit 0
  19. fi
  20. if egrep -qi '^[[:space:]]*Browsing[[:space:]]+(Yes|On)[[:space:]]*(#.*)?$' $CONF; then
  21.     exit 1
  22. fi
  23. exit 2
  24.