Last active
February 17, 2022 19:03
-
-
Save urpylka/9826b547df45e6767a92d971bf314894 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
autorefresh() { | |
test -d /etc/cups || return 1 | |
echo puk | |
/usr/bin/inotifywait -m -e close_write,moved_to,create /etc/cups | | |
while read -r directory events filename; do | |
if [ "$filename" = "printers.conf" ]; then | |
rm -rf /services/AirPrint-*.service | |
/root/airprint-generate.py -d /services | |
cp /etc/cups/printers.conf /config/printers.conf | |
rsync -avh /services/ /etc/avahi/services/ | |
fi | |
done | |
} | |
autorefresh & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# | |
# Start docker image that provides a CUPS instance | |
# | |
# Author: Thomas Bendler <[email protected]> | |
# Date: Sat Dec 8 15:46:29 CET 2018 | |
# | |
# Release: v1.3 | |
# | |
# ChangeLog: v0.1 - Initial release | |
# v1.2 - First production ready release (align with image version) | |
# v1.3 - Add avahi | |
# | |
### Set standard password if not set with local environment variable ### | |
if [ -n "${CUPS_PASSWORD}" ]; then | |
CUPS_PASSWORD=password | |
fi | |
### Run docker instance ### | |
docker run --detach --restart always \ | |
--cap-add=SYS_ADMIN -e "container=docker" \ | |
-e CUPS_ENV_HOST="$(hostname -f)" \ | |
-e CUPS_ENV_PASSWORD="${CUPS_PASSWORD}" \ | |
-e CUPS_ENV_DEBUG="${CUPS_DEBUG}" \ | |
--name cups --hostname cups.$(hostname -f | sed -e 's/^[^.]*\.//') \ | |
-p 137:137/udp -p 139:139/tcp -p 445:445/tcp \ | |
-p 631:631/tcp -p 5353:5353/udp \ | |
thbe/cups |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment