You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo -e "${C_RED}Error: Must be a non-empty, absolute path. Aborting.${C_RESET}">&2
1010
1010
return 1
1011
1011
fi
1012
+
if [[ "$restore_dest"=="/"||"$restore_dest"=="/etc"||"$restore_dest"=="/usr" ]];then
1013
+
read -p "${C_RED}WARNING: You are restoring to a critical system directory ('$restore_dest')${C_RESET}. This is highly unusual and could damage your system. Are you absolutely sure? (y/n): " confirm_dangerous_restore
1014
+
if [[ "${confirm_dangerous_restore,,}"!="y" ]];then
1015
+
echo"Restore cancelled."
1016
+
return 1
1017
+
fi
1018
+
fi
1012
1019
local include_paths=()
1013
1020
read -p "Optional: Enter specific file(s) to restore, separated by spaces (leave blank for full restore): " -a include_paths
1014
1021
local restic_cmd=(restic restore "$snapshot_id" --target "$restore_dest" --verbose)
0 commit comments