#!/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