#!/bin/bash while true; do currenthour=$(date +%k%M) if [ $currenthour -eq 2355 ]; then shutdown -h now fi sleep 30 done