Skip to content

Instantly share code, notes, and snippets.

@stoph
Created February 27, 2015 03:32
Show Gist options
  • Save stoph/111ea86e9e9a16f9f484 to your computer and use it in GitHub Desktop.
Save stoph/111ea86e9e9a16f9f484 to your computer and use it in GitHub Desktop.
Simple script to quickly shutdown your Raspberry Pi
# Shutdown script
# mine lives in /usr/local/bin/sd
# be sure to 'sudo chmod +x /usr/local/bin/sd'
#!/bin/bash
read -r -p "Are you sure you want to shutdown? [y/N] " response
response=${response,,}
if [[ $response =~ ^(yes|y)$ ]]
then
sudo shutdown -h now
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment