Skip to content

Commit

Permalink
[Maintenance] Verify log directory is writable #362
Browse files Browse the repository at this point in the history
  • Loading branch information
GioF71 committed Dec 29, 2023
1 parent eed3742 commit 3f8553e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions app/bin/run-upmpdcli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,22 @@ if [ ! -w "$cache_directory" ]; then
echo "Cache directory [${cache_directory}] is not writable"
mkdir -p /tmp/cache
cache_directory="/tmp/cache"
else
echo "Cache directory [${cache_directory}] is writable"
fi
sed -i 's\CACHE_DIRECTORY\'"$cache_directory"'\g' $CONFIG_FILE

log_directory=/log
if [ ! -w "$log_directory" ]; then
echo "Log directory [${log_directory}] is not writable"
mkdir -p /tmp/log
log_directory="/tmp/log"
else
echo "Log directory [${log_directory}] is writable"
fi
sed -i 's\LOG_DIRECTORY\'"$log_directory"'\g' $CONFIG_FILE


cat $CONFIG_FILE

if [[ $current_user_id == 0 ]]; then
Expand Down
2 changes: 1 addition & 1 deletion app/conf/upmpdcli.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cachedir = CACHE_DIRECTORY
radiolist = /tmp/radiolist.conf
upradiostitle = Upmpdcli Radio List
#logfilename = /log/upmpdcli.log
logfilename = LOG_DIRECTORY/upmpdcli.log
#log level defaults to 2
#loglevel = LOG_LEVEL
#pkgdatadir=/usr/share/upmpdcli
Expand Down
1 change: 1 addition & 0 deletions doc/change-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Change Date|Major Changes
---|---
2023-12-29|Verify log directory to be writable (see [#362](https://github.com/GioF71/upmpdcli-docker/issues/362))
2023-12-29|Removed last references to deezer (see [#359](https://github.com/GioF71/upmpdcli-docker/issues/359))
2023-12-29|Support running as user with `--user` (see [#358](https://github.com/GioF71/upmpdcli-docker/issues/358))
2023-12-19|Default naming of oh renderer (see [#356](https://github.com/GioF71/upmpdcli-docker/issues/356))
Expand Down

0 comments on commit 3f8553e

Please sign in to comment.