I would like to add a printer at system startup if one is not present.
I created /etc/rc.d/rc.local and made the file executable
if [ ! -f "/etc/cups/ppd/Officejet-6700.ppd" ]; then
/sbin/lpadmin -p Officejet-6700 -o printer-is-shared=false -L "Office" -E -v hp:/net/Officejet_6700?ip=172.16.0.2 -m lsb/usr/HP/hp-officejet_6700.ppd.gz -d Officejet-6700
touch /root/createdprinter.txt
else
touch /root/printerexists.txt
/sbin/lpadmin -p Officejet-6700 -o printer-is-shared=false -L "Office" -E -v hp:/net/Officejet_6700?ip=172.16.0.2 -m lsb/usr/HP/hp-officejet_6700.ppd.gz -d Officejet-6700
touch /root/createdprinter.txt
else
touch /root/printerexists.txt
fi
After
boot I get the file /root/createdprinter.txt but no printer was
created. if the printer exists before I reboot I get
/root/printerexists.txt so I know the startup script runs properly. I
run the exact lpadmin command as the script in root terminal and works
fine.
Why does that command not want to work in a startup script? Is the boot environment different?
--Thanks
_______________________________________________ users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx