mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-19 21:03:19 -07:00
Added check for root in AUTOSTART
The script never should get to the point of trying to restart a reinstalled service if it wasn't installed with sudo, but it's a good idea to have this check regardless.
This commit is contained in:
parent
3408308c9d
commit
b08b63c39e
1 changed files with 14 additions and 0 deletions
|
@ -320,4 +320,18 @@ if [ "${AUTOSTART}" == "yes" ]; then
|
|||
sudo service plexmediaserver start
|
||||
fi
|
||||
|
||||
if [ "${AUTOSTART}" == "yes" then
|
||||
if [ "${REDHAT}" == "no" ]; then
|
||||
echo "The AUTOSTART [-s] option may not be needed on your distribution."
|
||||
fi
|
||||
id | grep 'uid=0(' 2>&1 >/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error: You need to be root to use autoinstall option."
|
||||
exit 1
|
||||
elif [ "${REDHAT}" == "no" ]; then
|
||||
echo "The AUTOSTART [-s] option may not be needed on your distribution."
|
||||
fi
|
||||
sudo service plexmediaserver start
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue