Skip to content

Commit

Permalink
fixed rsyslog start call
Browse files Browse the repository at this point in the history
  • Loading branch information
shitwolfymakes committed Mar 27, 2022
1 parent 5356e65 commit e98ee5b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ VOLUME /home/arm/config
WORKDIR /home/arm

ENTRYPOINT ["/opt/arm/scripts/docker/docker-entrypoint.sh"]
CMD service rsyslog start
CMD ["python3", "/opt/arm/arm/runui.py"]

###########################################################
Expand Down
51 changes: 28 additions & 23 deletions scripts/docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,50 @@ export HOME="/home/${USER}"
echo "creating group [${UID}] with id ${GID}"
groupadd -fo -g "${GID}" "${USER}"
if ! id -u "${USER}" ; then
echo "creating user [${USER}] with id ${UID}"
useradd --shell /bin/bash \
-u "${UID}" -g "${GID}" -G video,cdrom \
-o -c "" "${USER}"
chown "${USER}.${USER}" "${HOME}"
echo "creating user [${USER}] with id ${UID}"
useradd --shell /bin/bash \
-u "${UID}" -g "${GID}" -G video,cdrom \
-o -c "" "${USER}"
chown "${USER}.${USER}" "${HOME}"
fi

# setup needed/expected dirs if not found
SUBDIRS="config media media/completed media/raw media/movies logs db Music .MakeMKV"
for dir in $SUBDIRS ; do
thisDir="${HOME}/${dir}"
if [[ ! -d "${thisDir}" ]] ; then
echo "creating dir ${thisDir}"
mkdir -p -m 0777 "${thisDir}"
chown -R "${USER}.${USER}" "${thisDir}"
fi
thisDir="${HOME}/${dir}"
if [[ ! -d "${thisDir}" ]] ; then
echo "creating dir ${thisDir}"
mkdir -p -m 0777 "${thisDir}"
chown -R "${USER}.${USER}" "${thisDir}"
fi
done
if [[ ! -f "${HOME}/config/arm.yaml" ]] ; then
echo "creating example ARM config ${HOME}/config/arm.yaml"
cp /opt/arm/docs/arm.yaml.sample "${HOME}/config/arm.yaml"
chown "${USER}.${USER}" "${HOME}/config/arm.yaml"
echo "creating example ARM config ${HOME}/config/arm.yaml"
cp /opt/arm/docs/arm.yaml.sample "${HOME}/config/arm.yaml"
chown "${USER}.${USER}" "${HOME}/config/arm.yaml"
fi
if [[ ! -f "${HOME}/config/apprise.yaml" ]] ; then
echo "creating example apprise config ${HOME}/config/apprise.yaml"
cp /opt/arm/docs/apprise.yaml "${HOME}/config/apprise.yaml"
chown "${USER}.${USER}" "${HOME}/config/apprise.yaml"
echo "creating example apprise config ${HOME}/config/apprise.yaml"
cp /opt/arm/docs/apprise.yaml "${HOME}/config/apprise.yaml"
chown "${USER}.${USER}" "${HOME}/config/apprise.yaml"
fi
if [[ ! -f "${HOME}/.abcde.conf" ]] ; then
echo "creating example abcde config ${HOME}/.abcde.conf"
cp /opt/arm/setup/.abcde.conf "${HOME}/.abcde.conf"
ln -sv "${HOME}/.abcde.conf" "${HOME}/config/.abcde.conf"
chown "${USER}.${USER}" "${HOME}/.abcde.conf"
echo "creating example abcde config ${HOME}/.abcde.conf"
cp /opt/arm/setup/.abcde.conf "${HOME}/.abcde.conf"
ln -sv "${HOME}/.abcde.conf" "${HOME}/config/.abcde.conf"
chown "${USER}.${USER}" "${HOME}/.abcde.conf"
fi

[[ -h /dev/cdrom ]] || ln -sv /dev/sr0 /dev/cdrom

if ! [[ -z $(service rsyslog status | grep "not running") ]] ; then
echo "Starting rsyslog service..."
service rsyslog start
fi

if [[ "${RUN_AS_USER:-true}" == "true" ]] ; then
exec /usr/sbin/gosu arm "$@"
exec /usr/sbin/gosu arm "$@"
else
exec "$@"
exec "$@"
fi

0 comments on commit e98ee5b

Please sign in to comment.