v1.5 - logging fixes
This commit is contained in:
parent
bd8bb5bfca
commit
0a7844347b
1 changed files with 17 additions and 14 deletions
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
scriptVersion="1.4"
|
scriptVersion="1.5"
|
||||||
scriptName="AutoConfig"
|
scriptName="AutoConfig"
|
||||||
|
|
||||||
#### Import Settings
|
#### Import Settings
|
||||||
|
@ -10,6 +10,22 @@ log () {
|
||||||
echo $m_time" :: $scriptName :: $scriptVersion :: "$1
|
echo $m_time" :: $scriptName :: $scriptVersion :: "$1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logfileSetup () {
|
||||||
|
# auto-clean up log file to reduce space usage
|
||||||
|
if [ -f "/config/logs/$scriptName.txt" ]; then
|
||||||
|
find /config/logs -type f -name "$scriptName.txt" -size +1024k -delete
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "/config/logs/$scriptName.txt" ]; then
|
||||||
|
touch "/config/logs/$scriptName.txt"
|
||||||
|
chmod 666 "/config/logs/$scriptName.txt"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Create Log, start writing...
|
||||||
|
logfileSetup
|
||||||
|
exec &> >(tee -a "/config/logs/$scriptName.txt")
|
||||||
|
|
||||||
if [ "$enableAutoConfig" != "true" ]; then
|
if [ "$enableAutoConfig" != "true" ]; then
|
||||||
log "Script is not enabled, enable by setting enableAutoConfig to \"true\" by modifying the \"/config/extended.conf\" config file..."
|
log "Script is not enabled, enable by setting enableAutoConfig to \"true\" by modifying the \"/config/extended.conf\" config file..."
|
||||||
log "Sleeping (infinity)"
|
log "Sleeping (infinity)"
|
||||||
|
@ -55,19 +71,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
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f "/config/logs/AutoConfig.txt" ]; then
|
|
||||||
touch "/config/logs/AutoConfig.txt"
|
|
||||||
chmod 666 "/config/logs/AutoConfig.txt"
|
|
||||||
fi
|
|
||||||
exec &> >(tee -a "/config/logs/AutoConfig.txt")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [ -f /config/extended/naming.json ]; then
|
if [ -f /config/extended/naming.json ]; then
|
||||||
log "Using custom Sonarr Naming (/config/extended/naming.json)..."
|
log "Using custom Sonarr Naming (/config/extended/naming.json)..."
|
||||||
namingJson=$(cat /config/extended/naming.json)
|
namingJson=$(cat /config/extended/naming.json)
|
||||||
|
|
Loading…
Reference in a new issue