test
This commit is contained in:
parent
07e30e2f4f
commit
e7bf62e944
@ -1,3 +1,45 @@
|
|||||||
|
|
||||||
|
# Extract specified value from override file if it exists (Null if not)
|
||||||
|
GetOverride() {
|
||||||
|
|
||||||
|
Retval=""
|
||||||
|
|
||||||
|
# Don't know if we have pushd so do it long hand
|
||||||
|
CurrDir="$(pwd)"
|
||||||
|
|
||||||
|
# Find the metadata dir if customized
|
||||||
|
if [ -e /etc/systemd/system/plexmediaserver.service.d ]; then
|
||||||
|
|
||||||
|
# Get there
|
||||||
|
cd /etc/systemd/system/plexmediaserver.service.d
|
||||||
|
|
||||||
|
# Glob up all 'conf files' found
|
||||||
|
ConfFile="$(find override.conf local.conf *.conf 2>/dev/null | head -1)"
|
||||||
|
|
||||||
|
# If there is one, search it
|
||||||
|
if [ "$ConfFile" != "" ]; then
|
||||||
|
Retval="$(grep "$1" $ConfFile | head -1 | sed -e "s/.*${1}=//" | tr -d \" | tr -d \')"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Go back to where we were
|
||||||
|
cd "$CurrDir"
|
||||||
|
|
||||||
|
# What did we find
|
||||||
|
echo "$Retval"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Universal output function
|
||||||
|
Output() {
|
||||||
|
if [ $Scripted -gt 0 ]; then
|
||||||
|
echo \[$(date "+%Y-%m-%d %H.%M.%S")\] "$@"
|
||||||
|
else
|
||||||
|
echo "$@"
|
||||||
|
fi
|
||||||
|
# $LOG_TOOL \[$(date "+%Y-%m-%d %H.%M.%S")\] "$@"
|
||||||
|
}
|
||||||
|
|
||||||
# Determine which host we are running on and set variables
|
# Determine which host we are running on and set variables
|
||||||
HostConfig() {
|
HostConfig() {
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user