mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-14 02:26:56 -07:00
Added control of package manager
Also fixed long-standing issue with KEEP not working
This commit is contained in:
parent
3a6ec96422
commit
5bad5cbe0f
2 changed files with 13 additions and 3 deletions
|
@ -42,6 +42,10 @@ There are a few other options for the more enterprising user. Setting any of the
|
|||
Normally plexupdate.sh will avoid downloading a file it already has or if it's the same as the installed version, but this allows you to override.
|
||||
- PRINT_URL
|
||||
Authenticate, fetch the download URL, print it, and then exit.
|
||||
- REDHAT_INSTALL
|
||||
The commandline used to install .rpm packages, only change if you need special options
|
||||
- DEBIAN_INSTALL
|
||||
The commandline used to install .deb packages, only change if you need special options
|
||||
|
||||
Most of these options can be specified on the command-line as well, this is just a more convenient way of doing it if you're scripting it. Which brings us to...
|
||||
|
||||
|
|
|
@ -57,6 +57,10 @@ AUTODELETE=no
|
|||
AUTOUPDATE=no
|
||||
AUTOSTART=no
|
||||
|
||||
# Default options for package managers, override if needed
|
||||
REDHAT_INSTALL="yum -y install"
|
||||
DEBIAN_INSTALL="dpkg -i"
|
||||
|
||||
# Sanity, make sure wget is in our path...
|
||||
wget >/dev/null 2>/dev/null
|
||||
if [ $? -eq 127 ]; then
|
||||
|
@ -205,9 +209,11 @@ keypair() {
|
|||
|
||||
# Setup an exit handler so we cleanup
|
||||
function cleanup {
|
||||
rm /tmp/kaka 2>/dev/null >/dev/null
|
||||
rm /tmp/postdata 2>/dev/null >/dev/null
|
||||
rm /tmp/raw 2>/dev/null >/dev/null
|
||||
if [ "${KEEP}" != "yes" ]; then
|
||||
rm /tmp/kaka 2>/dev/null >/dev/null
|
||||
fi
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
|
@ -328,9 +334,9 @@ fi
|
|||
|
||||
if [ "${AUTOINSTALL}" == "yes" ]; then
|
||||
if [ "${REDHAT}" == "yes" ]; then
|
||||
sudo yum -y install "${DOWNLOADDIR}/${FILENAME}"
|
||||
sudo ${REDHAT_INSTALL} "${DOWNLOADDIR}/${FILENAME}"
|
||||
else
|
||||
sudo dpkg -i "${DOWNLOADDIR}/${FILENAME}"
|
||||
sudo ${DEBIAN_INSTALL} "${DOWNLOADDIR}/${FILENAME}"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue