3 PC_USER="${PC_USER:-package-cache}"
4 PC_GROUP="${PC_GROUP:-portage}"
5 CACHE_DIR="${CACHE_DIR:-/usr/portage}"
6 HOST="${HOST:-0.0.0.0}"
8 SOURCES="${SOURCES:-http://distfiles.gentoo.org}"
10 for SOURCE in ${SOURCES}
12 SOURCE_OPTS+=( --source "${SOURCE}" )
14 command="/usr/bin/package-cache"
15 pidfile="/run/${SVCNAME}.pid"
22 ebegin "Starting ${SVCNAME}"
23 if [[ ! -d "${CACHE_DIR}" ]]; then
24 mkdir -p "${CACHE_DIR}"
25 chown "${PC_USER}:${PC_GROUP}" "${CACHE_DIR}"
27 start-stop-daemon --start \
28 --user "${PC_USER}:${PC_GROUP}" \
29 --chdir "${CACHE_DIR}" \
32 --pidfile "${pidfile}" \
39 --cache "${CACHE_DIR}" \
40 ${PC_OPTS:+${PC_OPTS}}
45 ebegin "Stopping ${SVCNAME}"
46 start-stop-daemon --stop \
47 --user "${PC_USER}:${PC_GROUP}" \
49 --pidfile "${pidfile}"