Skip to content

Instantly share code, notes, and snippets.

@k4rtik
Created April 28, 2012 13:10
Show Gist options
  • Save k4rtik/2518975 to your computer and use it in GitHub Desktop.
Save k4rtik/2518975 to your computer and use it in GitHub Desktop.
Simple script to let me know the temperatures of my laptop, hddtemp requires sudo making this script more than 3 lines.
#!/bin/bash
sensors
aticonfig --odgt
answer="N"
if [ "$(whoami)" != "root" ]; then
echo -ne "\n\nDo you want to know hard disk temperature (requires sudo)? (y/N) "
read answer
if [ "$answer" == "y" ]; then
{
sudo hddtemp /dev/sda
}
else
{
exit 0
}
fi
else
echo
sudo hddtemp /dev/sda
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment