v1.6 - AutoConfig Enablement Bug fix and improved logging
#14 - Should now be resolved...
This commit is contained in:
parent
e800781c58
commit
32cafcfbf8
1 changed files with 16 additions and 14 deletions
|
@ -1,11 +1,26 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
scriptVersion="1.5"
|
scriptVersion="1.6"
|
||||||
|
|
||||||
log () {
|
log () {
|
||||||
m_time=`date "+%F %T"`
|
m_time=`date "+%F %T"`
|
||||||
echo $m_time" :: AutoConfig :: $scriptVersion :: "$1
|
echo $m_time" :: AutoConfig :: $scriptVersion :: "$1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# auto-clean up log file to reduce space usage
|
||||||
|
if [ -f "/config/logs/AutoConfig.txt" ]; then
|
||||||
|
find /config/logs -type f -name "AutoConfig.txt" -size +1024k -delete
|
||||||
|
sleep 0.01
|
||||||
|
fi
|
||||||
|
exec &> >(tee -a "/config/logs/AutoConfig.txt")
|
||||||
|
touch "/config/logs/AutoConfig.txt"
|
||||||
|
chmod 666 "/config/logs/AutoConfig.txt"
|
||||||
|
|
||||||
|
if [ "$enableAutoConfig" != "true" ]; then
|
||||||
|
log "Script is not enabled, enable by setting enableAutoConfig to \"true\" by modifying the \"/config/extended.conf\" config file..."
|
||||||
|
log "Sleeping (infinity)"
|
||||||
|
sleep infinity
|
||||||
|
fi
|
||||||
|
|
||||||
getArrAppInfo () {
|
getArrAppInfo () {
|
||||||
# Get Arr App information
|
# Get Arr App information
|
||||||
if [ -z "$arrUrl" ] || [ -z "$arrApiKey" ]; then
|
if [ -z "$arrUrl" ] || [ -z "$arrApiKey" ]; then
|
||||||
|
@ -45,19 +60,6 @@ verifyApiAccess () {
|
||||||
getArrAppInfo
|
getArrAppInfo
|
||||||
verifyApiAccess
|
verifyApiAccess
|
||||||
|
|
||||||
# auto-clean up log file to reduce space usage
|
|
||||||
if [ -f "/config/logs/AutoConfig.txt" ]; then
|
|
||||||
find /config/logs -type f -name "AutoConfig.txt" -size +1024k -delete
|
|
||||||
sleep 0.01
|
|
||||||
fi
|
|
||||||
exec &> >(tee -a "/config/logs/AutoConfig.txt")
|
|
||||||
touch "/config/logs/AutoConfig.txt"
|
|
||||||
chmod 666 "/config/logs/AutoConfig.txt"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
log "Configuring Lidarr Media Management Settings"
|
log "Configuring Lidarr Media Management Settings"
|
||||||
postSettingsToLidarr=$(curl -s "$arrUrl/api/v1/config/mediamanagement" -X PUT -H 'Content-Type: application/json' -H "X-Api-Key: ${arrApiKey}" --data-raw '{"autoUnmonitorPreviouslyDownloadedTracks":false,"recycleBin":"","recycleBinCleanupDays":7,"downloadPropersAndRepacks":"preferAndUpgrade","createEmptyArtistFolders":true,"deleteEmptyFolders":true,"fileDate":"albumReleaseDate","watchLibraryForChanges":false,"rescanAfterRefresh":"never","allowFingerprinting":"never","setPermissionsLinux":false,"chmodFolder":"777","chownGroup":"","skipFreeSpaceCheckWhenImporting":false,"minimumFreeSpaceWhenImporting":100,"copyUsingHardlinks":true,"importExtraFiles":true,"extraFileExtensions":"jpg,png,lrc","id":1}')
|
postSettingsToLidarr=$(curl -s "$arrUrl/api/v1/config/mediamanagement" -X PUT -H 'Content-Type: application/json' -H "X-Api-Key: ${arrApiKey}" --data-raw '{"autoUnmonitorPreviouslyDownloadedTracks":false,"recycleBin":"","recycleBinCleanupDays":7,"downloadPropersAndRepacks":"preferAndUpgrade","createEmptyArtistFolders":true,"deleteEmptyFolders":true,"fileDate":"albumReleaseDate","watchLibraryForChanges":false,"rescanAfterRefresh":"never","allowFingerprinting":"never","setPermissionsLinux":false,"chmodFolder":"777","chownGroup":"","skipFreeSpaceCheckWhenImporting":false,"minimumFreeSpaceWhenImporting":100,"copyUsingHardlinks":true,"importExtraFiles":true,"extraFileExtensions":"jpg,png,lrc","id":1}')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue