Sure, here's a simple shell script in CentOS that will automatically shut down the system after a specified amount of time:
#!/bin/bash
# Set the amount of time to wait before shutting down
time_to_wait=60
# Display a message to the user
echo "System will shut down in $time_to_wait seconds."
# Wait for the specified amount of time
sleep $time_to_wait
# Shut down the system
shutdown -h now
Save this script as a file with a .sh
extension, make it executable with chmod +x filename.sh
, then run it with ./filename.sh
. The system will shut down after 60 seconds. You can adjust the time_to_wait
variable to set a different amount of time.