mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-19 04:49:34 -07:00
Merge pull request #10 from mpwdawson/master
Add delete after auto install switch
This commit is contained in:
commit
1fec4755b6
1 changed files with 12 additions and 1 deletions
|
@ -47,6 +47,7 @@ KEEP=no
|
||||||
FORCE=no
|
FORCE=no
|
||||||
PUBLIC=no
|
PUBLIC=no
|
||||||
AUTOINSTALL=no
|
AUTOINSTALL=no
|
||||||
|
AUTODELETE=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
|
||||||
|
@ -70,8 +71,9 @@ set -- $(getopt fhko: -- "$@")
|
||||||
while true;
|
while true;
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
(-h) echo -e "Usage: $(basename $0) [-afhkop]\n\na = Auto install if download was successful (requires root)\nf = Force download even if it's the same version or file already exists (WILL NOT OVERWRITE)\nh = This help\nk = Reuse last authentication\no = 32-bit version (default 64 bit)\np = Public Plex Media Server version"; exit 0;;
|
(-h) echo -e "Usage: $(basename $0) [-afhkop]\n\na = Auto install if download was successful (requires root)\nd = Auto delete after auto install\nf = Force download even if it's the same version or file already exists (WILL NOT OVERWRITE)\nh = This help\nk = Reuse last authentication\no = 32-bit version (default 64 bit)\np = Public Plex Media Server version"; exit 0;;
|
||||||
(-a) AUTOINSTALL=yes;;
|
(-a) AUTOINSTALL=yes;;
|
||||||
|
(-d) AUTODELETE=yes;;
|
||||||
(-f) FORCE=yes;;
|
(-f) FORCE=yes;;
|
||||||
(-k) KEEP=yes;;
|
(-k) KEEP=yes;;
|
||||||
(-o) RELEASE="32-bit";;
|
(-o) RELEASE="32-bit";;
|
||||||
|
@ -249,4 +251,13 @@ if [ "${AUTOINSTALL}" == "yes" ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${AUTODELETE}" == "yes" ]; then
|
||||||
|
if [ "${AUTOINSTALL}" == "yes" ]; then
|
||||||
|
rm -rf "${DOWNLOADDIR}/${FILENAME}"
|
||||||
|
echo "Deleted \"${FILENAME}\""
|
||||||
|
else
|
||||||
|
echo "Will not auto delete without [-a] auto install"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue