Skip to content

Commit

Permalink
dont touch config file
Browse files Browse the repository at this point in the history
  • Loading branch information
fabricionaweb committed Apr 7, 2024
1 parent 85464b8 commit 6621215
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions rootfs/etc/s6-overlay/s6-rc.d/lidarr/run
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,14 @@ CONFIG_FILE=/config/config.xml

# create initial config file
if [[ ! -f "$CONFIG_FILE" ]]; then
TMP_FILE="/tmp/$0.$$.$RANDOM"
TMP_FILE="$(mktemp)"
cat <<EOF >"$TMP_FILE"
<Config>
<AnalyticsEnabled>False</AnalyticsEnabled>
</Config>
EOF

install -m644 -o $PUID -g $PGID "$TMP_FILE" "$CONFIG_FILE"
elif [[ $(grep -c "<AnalyticsEnabled>" "$CONFIG_FILE") == 0 ]]; then
# if analytics doenst exist in config, insert one
sed -i "/<Config>/a\ \ <AnalyticsEnabled>False<\/AnalyticsEnabled>" "$CONFIG_FILE"
else
# disable analytics
sed -i "/<AnalyticsEnabled>/s/>.*<\//>False<\//" "$CONFIG_FILE"
fi

# change chdir
Expand Down

0 comments on commit 6621215

Please sign in to comment.