Take all sites in a multisite environment offline at the same time
If you have drush installed you could use this snippet:

#!/bin/bash
sites[0] = "http://www1.example.com";
sites[1] = "http://www2.example.com";
sites[2] = "http://www3.example.com";

for site in $sites; do
  drush vset --always-set --uri=$site site_offline 1 
done


I'm not an expert in sh scripting but something like that should work.