From 16514b4face24c18126bc43589e2c372336d4eac Mon Sep 17 00:00:00 2001 From: Alex Malinovich Date: Sun, 20 Nov 2016 19:39:29 -0800 Subject: [PATCH] Remove saveconfig --- plexupdate.sh | 40 +--------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/plexupdate.sh b/plexupdate.sh index d58196a..ab6bf46 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -129,7 +129,6 @@ usage() { echo " --pass Plex.TV password" echo " --server Address of Plex Server" echo " --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"