base-files: sysupgrade: Allow downloading of firmware images using HTTPS
[openwrt/staging/hauke.git] / package / base-files / files / sbin / sysupgrade
index a378b029500ac5981d504889b0b3e6af3cf92a0d..f42974360cfdcdd439a86736af27f49e032daba6 100755 (executable)
@@ -136,7 +136,7 @@ add_overlayfiles() {
 }
 
 # hooks
-sysupgrade_image_check="fwtool_check_image platform_check_image"
+sysupgrade_image_check="fwtool_check_signature fwtool_check_image platform_check_image"
 
 if [ $SAVE_OVERLAY = 1 ]; then
        [ ! -d /overlay/upper/etc ] && {
@@ -165,6 +165,11 @@ do_save_conffiles() {
        v "Saving config files..."
        [ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V=""
        tar c${TAR_V}zf "$conf_tar" -T "$CONFFILES" 2>/dev/null
+       if [ "$?" -ne 0 ]; then
+               echo "Failed to create the configuration backup."
+               rm -f "$conf_tar"
+               exit 1
+       fi
 
        rm -f "$CONFFILES"
 }
@@ -198,7 +203,8 @@ type platform_check_image >/dev/null 2>/dev/null || {
 }
 
 case "$IMAGE" in
-       http://*)
+       http://*|\
+       https://*)
                wget -O/tmp/sysupgrade.img "$IMAGE"
                IMAGE=/tmp/sysupgrade.img
                ;;