Tartalomjegyzék

Cups

Beállítások biztonsági mentése

launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist
tar cvzf cups-backup.tar.gz /etc/cups
launchctl load /System/Library/LaunchDaemons/org.cups.cupsd.plist

Szünetelő nyomtatók automatikus engedélyezése

  1. Hozzuk létre a nyomtató helyreállító /opt/tia/tia-enable-printers scriptet:
    tia-enable-printers
    #!/bin/bash -e
    PATH=/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
     
    lpstat -p |
        grep -i disabled |
        sed -E 's>^printer ([^ ]+) .*>\1>' |
        while read printer
        do
            cupsaccept "${printer}"
            cupsenable "${printer}"
        done
     
    exit 0
  2. Hozzuk létre az /opt/tia/tia.enable-printers.plist ütemezett feladatot:
    tia.enable-printers.plist
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>Label</key>
        <string>tia.enable-printers</string>
        <key>ProgramArguments</key>
        <array>
            <string>/opt/tia/tia-enable-printers</string>
        </array>
        <key>StartInterval</key>
        <integer>15</integer>
    </dict>
    </plist>
  3. Mozgassuk a helyére:
    mv '/opt/tia/tia.enable-printers.plist' '/Library/LaunchDaemons/'
  4. Töltsük be az ütemezett feladatot:
    launchctl load -w '/Library/LaunchDaemons/tia.enable-printers.plist'

Bug