mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-20 21:33:16 -07:00
Remove saveconfig
This commit is contained in:
parent
144989e9c3
commit
16514b4fac
1 changed files with 1 additions and 39 deletions
|
@ -129,7 +129,6 @@ usage() {
|
|||
echo " --pass <plex.tv password> Plex.TV password"
|
||||
echo " --server <Plex server address> Address of Plex Server"
|
||||
echo " --port <Plex server port> Port for Plex Server. Used with --server"
|
||||
echo " --saveconfig Save the configuration to config file"
|
||||
echo
|
||||
exit 0
|
||||
}
|
||||
|
@ -214,11 +213,7 @@ fi
|
|||
|
||||
# Parse commandline
|
||||
ALLARGS=( "$@" )
|
||||
optstring="acCdfFhlpPqrSsuUv -l config:,dldir:,email:,pass:,server:,port:,saveconfig"
|
||||
getopt -T >/dev/null
|
||||
if [ $? -eq 4 ]; then
|
||||
optstring="-o $optstring"
|
||||
fi
|
||||
optstring="-o acCdfFhlpPqrSsuU -l config:,dldir:,email:,pass:,server:,port:"
|
||||
GETOPTRES=$(getopt $optstring -- "$@")
|
||||
if [ $? -eq 1 ]; then
|
||||
exit 1
|
||||
|
@ -251,7 +246,6 @@ do
|
|||
(--pass) shift; PASS_CL="$1"; PASS_CL=$(trimQuotes ${PASS_CL});;
|
||||
(--server) shift; PLEXSERVER_CL="$1"; PLEXSERVER_CL=$(trimQuotes ${PLEXSERVER_CL});;
|
||||
(--port) shift; PLEXPORT_CL="$1"; PLEXPORT_CL=$(trimQuotes ${PLEXPORT_CL});;
|
||||
(--saveconfig) SAVECONFIG=yes;;
|
||||
|
||||
(--) ;;
|
||||
(-*) error "Unrecognized option $1"; usage; exit 1;;
|
||||
|
@ -289,38 +283,6 @@ do
|
|||
fi
|
||||
done
|
||||
|
||||
# This will destroy and recreate the config file. Any settings that are set in the config file but are no longer
|
||||
# valid will NOT be saved.
|
||||
if [ "${SAVECONFIG}" = "yes" ]; then
|
||||
echo "# Config file for plexupdate" >${CONFIGFILE}
|
||||
|
||||
for VAR in AUTOINSTALL AUTODELETE DOWNLOADDIR EMAIL PASS FORCE FORCEALL PUBLIC AUTOSTART AUTOUPDATE PLEXSERVER PLEXPORT CHECKUPDATE
|
||||
do
|
||||
if [ ! -z ${!VAR} ]; then
|
||||
|
||||
# The following keys have defaults set in this file. We don't want to include these values if they are the default.
|
||||
if [ ${VAR} = "FORCE" \
|
||||
-o ${VAR} = "FORCEALL" \
|
||||
-o ${VAR} = "PUBLIC" \
|
||||
-o ${VAR} = "AUTOINSTALL" \
|
||||
-o ${VAR} = "AUTODELETE" \
|
||||
-o ${VAR} = "AUTOUPDATE" \
|
||||
-o ${VAR} = "AUTOSTART" ]; then
|
||||
|
||||
if [ ${!VAR} = "yes" ]; then
|
||||
echo "${VAR}='${!VAR}'" >> ${CONFIGFILE}
|
||||
fi
|
||||
elif [ ${VAR} = "PLEXPORT" ]; then
|
||||
if [ ! "${!VAR}" = "32400" ]; then
|
||||
echo "${VAR}='${!VAR}'" >> ${CONFIGFILE}
|
||||
fi
|
||||
else
|
||||
echo "${VAR}='${!VAR}'" >> ${CONFIGFILE}
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "${SHOWPROGRESS}" = "yes" ]; then
|
||||
if ! wget --show-progress -V &>/dev/null; then
|
||||
warn "Your wget is too old to support --show-progress, ignoring"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue