We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 835afca commit f36fe0fCopy full SHA for f36fe0f
restic-backup.sh
@@ -235,6 +235,10 @@ check_for_script_update() {
235
return 1
236
fi
237
echo -e "${C_GREEN}✅ Checksum verified successfully.${C_RESET}"
238
+ if ! grep -q -E "^#!/(usr/)?bin/(env )?bash" "$temp_script"; then
239
+ echo -e "${C_RED}Downloaded file does not appear to be a valid script. Aborting update.${C_RESET}" >&2
240
+ return 1
241
+ fi
242
chmod +x "$temp_script"
243
mv "$temp_script" "$0"
244
if [ -n "${SUDO_USER:-}" ] && [[ "$SCRIPT_DIR" != /root* ]]; then
0 commit comments