Skip to content

Commit

Permalink
Set files to ownership under arm user
Browse files Browse the repository at this point in the history
  • Loading branch information
shitwolfymakes committed May 18, 2022
1 parent 0c4ecbb commit af165cc
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions scripts/docker/runit/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,29 @@
set -euo pipefail

export ARM_HOME="/home/arm"
chown -R arm:arm /opt/arm

# setup needed/expected dirs if not found
SUBDIRS="media media/completed media/raw media/movies logs db Music .MakeMKV"
for dir in $SUBDIRS ; do
thisDir="${ARM_HOME}/${dir}"
if [[ ! -d "${thisDir}" ]] ; then
echo "creating dir ${thisDir}"
mkdir -p 0777 "${thisDir}"
thisDir="$ARM_HOME/$dir"
if [[ ! -d "$thisDir" ]] ; then
echo "Creating dir: $thisDir"
mkdir -p 0777 "$thisDir"
fi
chown -R arm:arm "$thisDir"
done

# setup config files if not found
mkdir -p /etc/arm/config
CONFS="arm.yaml apprise.yaml .abcde.conf"
for conf in $CONFS; do
thisConf="/etc/arm/config/${conf}"
if [[ ! -f "${thisConf}" ]] ; then
thisConf="/etc/arm/config/$conf"
if [[ ! -f "$thisConf" ]] ; then
# Don't overwrite with defaults during reinstall
cp --no-clobber "/opt/arm/setup/${conf}" "${thisConf}"
cp --no-clobber "/opt/arm/setup/$conf" "$thisConf"
fi
chown -R arm:arm "$thisConf"
done

exec "$@"

0 comments on commit af165cc

Please sign in to comment.