Skip to content

Instantly share code, notes, and snippets.

@mertcangokgoz
Created January 24, 2019 05:04
Show Gist options
  • Save mertcangokgoz/ce4363e5fbda91857add637074572ef6 to your computer and use it in GitHub Desktop.
Save mertcangokgoz/ce4363e5fbda91857add637074572ef6 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# Author Mertcan GOKGOZ - 2016
# Bir sistemdeki tüm yazicilar icin cupsenable komutunun calıstirilmasi
set -e
YAZICILAR=`lpstat -p | grep printer | grep -v enable | awk '{print $2}' | sed '/^$/d'`
if [ "x$YAZICILAR" != "x" ]; then
for yaziciadi in $YAZICILAR; do
echo "Lutfen Bekleyin $yaziciadi Yazici Etkinlestiriliyor"
cupsenable -h 127.0.0.1:631 $yaziciadi && logger "$yaziciadi Yazici Etkinlestirildi"
done
fi
sleep 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment