More than 500 shops across France were hit in a major cyberattack on freezers, which caused tonnes of food to perish.