mirror of
https://github.com/RROrg/rr.git
synced 2025-06-21 05:51:05 +08:00
Re-added Addon external download
This commit is contained in:
parent
d3a5c72897
commit
13ecf8108d
@ -173,6 +173,7 @@ function addonMenu() {
|
|||||||
d "Delete addon(s)" \
|
d "Delete addon(s)" \
|
||||||
s "Show user addons" \
|
s "Show user addons" \
|
||||||
m "Show all available addons" \
|
m "Show all available addons" \
|
||||||
|
o "Download a external addon" \
|
||||||
e "Exit" \
|
e "Exit" \
|
||||||
2>${TMP_PATH}/resp
|
2>${TMP_PATH}/resp
|
||||||
[ $? -ne 0 ] && return
|
[ $? -ne 0 ] && return
|
||||||
@ -243,6 +244,30 @@ function addonMenu() {
|
|||||||
dialog --backtitle "`backtitle`" --title "Available addons" \
|
dialog --backtitle "`backtitle`" --title "Available addons" \
|
||||||
--colors --msgbox "${MSG}" 0 0
|
--colors --msgbox "${MSG}" 0 0
|
||||||
;;
|
;;
|
||||||
|
o)
|
||||||
|
TEXT="please enter the complete URL to download.\n"
|
||||||
|
dialog --backtitle "`backtitle`" --aspect 18 --colors --inputbox "${TEXT}" 0 0 \
|
||||||
|
2>${TMP_PATH}/resp
|
||||||
|
[ $? -ne 0 ] && continue
|
||||||
|
URL="`<"${TMP_PATH}/resp"`"
|
||||||
|
[ -z "${URL}" ] && continue
|
||||||
|
clear
|
||||||
|
echo "Downloading ${URL}"
|
||||||
|
curl --insecure -L "${URL}" -o "${TMP_PATH}/addon.tgz" --progress-bar
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
dialog --backtitle "`backtitle`" --title "Error downloading" --aspect 18 \
|
||||||
|
--msgbox "Check internet, URL or cache disk space" 0 0
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
ADDON="`untarAddon "${TMP_PATH}/addon.tgz"`"
|
||||||
|
if [ -n "${ADDON}" ]; then
|
||||||
|
dialog --backtitle "`backtitle`" --title "Success" --aspect 18 \
|
||||||
|
--msgbox "Addon '${ADDON}' added to loader" 0 0
|
||||||
|
else
|
||||||
|
dialog --backtitle "`backtitle`" --title "Invalid addon" --aspect 18 \
|
||||||
|
--msgbox "File format not recognized!" 0 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
e) return ;;
|
e) return ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user