mirror of
https://github.com/raspberrypi/rpi-update.git
synced 2026-01-20 21:13:38 +08:00
Sanity check contents of updated rpi-update
See: https://github.com/Hexxeh/rpi-update/issues/285
This commit is contained in:
@@ -84,6 +84,12 @@ function update_self() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$(head -1 ${_tempFileName})" != '#!/bin/bash' ]]; then
|
||||
echo " !!! Failed to download update for rpi-update!"
|
||||
echo " !!! Contents of file is not as expected - github may be down"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local OCTAL_MODE=$(stat -c '%a' "$0")
|
||||
if ! chmod ${OCTAL_MODE} "${_tempFileName}" ; then
|
||||
echo " !!! Failed: Error while trying to set mode on ${_tempFileName}"
|
||||
|
||||
Reference in New Issue
Block a user