Advertisement
cymplecy

Untitled

Feb 23rd, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.38 KB | None | 0 0
  1. #! /bin/bash
  2. echo $PWD
  3. WHERE=`ls -R /media/*/rjam2014menu.sh`
  4. WORKDIR=$(dirname ${WHERE})
  5. cd $WORKDIR
  6. echo $PWD
  7. BACKTITLE="Raspberry Jamboree 2014"
  8. TITLE="@Cymplecy's Wonderful Menu of Jamboree Goodies"
  9. whiptail --backtitle "$BACKTITLE" --title "$TITLE" --msgbox "On the next screen you will will a menu with oodles of good things to install on your Raspberry Pi. use the arrow and tab keys to move around the menu and highlight the various items or buttons then press the return key to select that item. You must hit OK to continue." 10 78
  10. status="0"
  11. while [ "$status" -eq 0 ]
  12. do
  13.     choice=$(whiptail --cancel-button Exit --backtitle "$BACKTITLE" --title "$TITLE" --menu "Make a choice" 16 78 5 \
  14.     "ScratchGPIO4" "ScratchGPIO4 Installer" \
  15.     "MinecraftBook" "Description of Application 2" \
  16.     "Mario" "Description of Application 3" 3>&2 2>&1 1>&3)
  17.     option=$(echo $choice | tr '[:upper:]' '[:lower:]' | sed 's/ //g')
  18.     case "${option}" in
  19.         scratchgpio4)
  20.         echo $PWD
  21.          sudo /bin/bash ${PWD}/scratchgpio4/isgh4.sh
  22.         ;;
  23.         MinecraftBook)
  24.          sudo /bin/bash xpdf ${PWD}/minecraftbook/minecraftbook.pdf
  25.         ;;
  26.         Mario)
  27.           sudo /bin/bash python ${PWD}/mario/mario_level_1.py
  28.         ;;
  29.         *) sleep 5
  30.             printf "Good Byeeeeeeeeeeeee!!!\n"
  31.             status=1
  32.             exit
  33.         ;;
  34.     esac
  35. done
  36. ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement