Adding -r parameter for autostart of service

This will be an optional parameter that will be useful for RHEL/CentOS, and potentially other distributions.
This commit is contained in:
Devin Slick 2015-10-23 14:49:51 -05:00
commit 4e91d842a1

View file

@ -55,6 +55,7 @@ PUBLIC=no
AUTOINSTALL=no AUTOINSTALL=no
AUTODELETE=no AUTODELETE=no
AUTOUPDATE=no AUTOUPDATE=no
AUTOSTART=no
# Sanity, make sure wget is in our path... # Sanity, make sure wget is in our path...
wget >/dev/null 2>/dev/null wget >/dev/null 2>/dev/null
@ -88,6 +89,7 @@ do
(-p) PUBLIC=yes;; (-p) PUBLIC=yes;;
(-u) AUTOUPDATE=yes;; (-u) AUTOUPDATE=yes;;
(-U) AUTOUPDATE=no;; (-U) AUTOUPDATE=no;;
(-r) AUTOSTART=no;;
(--) ;; (--) ;;
(-*) echo "Error: unrecognized option $1" 1>&2; exit 1;; (-*) echo "Error: unrecognized option $1" 1>&2; exit 1;;
(*) break;; (*) break;;
@ -310,4 +312,12 @@ if [ "${AUTODELETE}" == "yes" ]; then
fi fi
fi fi
if [ "${AUTOSTART}" == "yes" ]; then
if [ "${AUTOSTART}" == "yes" ]; then
service plexmediaserver start
else
echo "Will not attempt to auto start plexmediaserver service without [-r] restart"
fi
fi
exit 0 exit 0