Qc.sh

From FGWiki
Jump to: navigation, search
  1. !/bin/bash
  1. Perhaps a autorun CD should be created that will download this file from the wiki
  2. and then run it using sudo. This way, the CD and network is already tested!
  1. wget -O ~/qc.sh "http://wiki.freegeekvancouver.org/w/index.php?action=raw&ctype=text/css&title=Qc.sh"
  2. chmod 777 ~/qc.sh
  3. sudo ~/qc.sh
  1. Program must be root or sudo

function pause() {

 echo -n "Push ENTER key to continue..."
 read

}

trap SIGHUP sysctl -w dev.cdrom.lock=0 if [ ! -e ~/qc.sh.1 ]; then

 export MOUNTED=`pwd`
 cd ~
 echo 1 > ~/qc.sh.1
 /usr/bin/gnome-terminal --geometry=132x40 -e ~/qc.sh &
 exit

fi rm ~/qc.sh.1 eject $MOUNTED clear dd if=/dev/urandom count=2 | aplay -t raw aplay /usr/share/sounds/info.wav clear echo "FREE GEEK" echo "===" echo "Update will start next. Sound played after update completed." pause export http_proxy="http://apt:3142" apt-get -y update apt-get -y upgrade ldconfig dd if=/dev/urandom count=2 | aplay -t raw aplay /usr/share/sounds/info.wav echo "===" pause cat /proc/cpuinfo pause lshw -short pause lspci echo "===" echo "Will test video/audio next." pause echo "Video playing (tests audio as well), push CTRL+Q to exit" if [ -f "/usr/share/example-content/Experience ubuntu.ogg" ]; then

 totem "/usr/share/example-content/Experience ubuntu.ogg"

elif [ -f "/usr/share/example-content/Ubuntu_Free_Culture_Showcase/SpiritOfUbuntu.ogv" ]; then

 totem "/usr/share/example-content/Ubuntu_Free_Culture_Showcase/SpiritOfUbuntu.ogv"

elif [ -f "/usr/share/example-content/Ubuntu_Free_Culture_Showcase/water-and-wind.ogv" ]; then

 totem "/usr/share/example-content/Ubuntu_Free_Culture_Showcase/water-and-wind.ogv"

elif [ -f "/usr/share/example-content/Ubuntu_Free_Culture_Showcase/UbuntuIsHumanity.ogv" ]; then

 totem "/usr/share/example-content/Ubuntu_Free_Culture_Showcase/UbuntuIsHumanity.ogv"

else

 echo "Error: There is no video to play! Please correct this script to add the correct filenames."
 echo "Edit the script at:  http://wiki.freegeekvancouver.org/act/edit/Qc.sh"
 echo "(You will need an account at the wiki to do so)"

fi echo "===" echo "Will test stress next." pause

  1. dpkg-query -s stress; export stress_installed=$?
  2. (exit $stress_installed) || apt-get install stress

echo "Running stress test for 180 seconds..." stress --cpu 10 --io 4 --vm 10 --vm-bytes 10M --hdd 2 --timeout 180 || (

 apt-get install stress
 stress --cpu 10 --io 4 --vm 10 --vm-bytes 10M --hdd 2 --timeout 180
 apt-get -y remove stress

) echo "Done."

  1. (exit $stress_installed) || apt-get -y remove stress

dd if=/dev/urandom count=2 | aplay -t raw aplay /usr/share/sounds/info.wav echo "===" echo "Push ENTER to shut down. Push CTRL+C to cancel." pause echo "Preparing to shut down..." shutdown -P now