#!/bin/bash for host in *{spg,sc,sw}*.sunet.se; do echo "Rebooting $host" ssh $host 'systemctl reboot' done