witchcraft2012-1-0.sh 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #! /bin/bash
  2. #written by digit (+ the community). most ambitious project yet. see http://github.com/Digit/witch for more
  3. clear #neatness freak
  4. ### dont be bothered if the comments seem outta wack, they are. ...need to go clean that up some more still.
  5. # will remove this guff when the comments n shiz r cleaned up of those redundant or irelevent or outdated or just guff...
  6. # digit's new simple tree plan/notion of what witchcraft is about.
  7. #version (probably gonna keep version as "concept v0.00" until it's at least ready for a trial run.
  8. echo "VERSION: gentoo install test v0.00 " #oldversion#echo "VERSION: concept v0.00"
  9. echo "(means dont try to run it yet, for the sake of your computer. retreat while you can.)"
  10. ##dev-intro
  11. #for sake of navigation, check out the functions: rewic, cauldren (and it's functions), distroselector, deskfigselector. they're all launched in a tree of options, starting at the end of this script, after all the functions have been defined.
  12. echo
  13. #intro
  14. sleep 1
  15. echo "Hi, \"$USER\"."
  16. sleep 1
  17. echo "welcome to the latest incarnation of the witchcraft script."
  18. sleep 1
  19. questions() {
  20. # your native directory
  21. echo "Your native directory is... $WITCH"
  22. $WITCH/color.sh QUESTION "what is your prefered text editor? (type the name of it's executable as exists on host system):"
  23. read EDITOR
  24. echo $EDITOR > $WITCH/config.txt #1st line
  25. $WITCH/color.sh QUESTION "what is your prefered web browser? (type the name of it's executable as exists on host system):"
  26. read BROWSER
  27. echo $BROWSER >> $WITCH/config.txt #2nd line
  28. $WITCH/color.sh QUESTION "so... you need a proxy? you might want to stay hidden :P just press enter if you don't know what i am talking about or you don't need one"
  29. read PROX
  30. echo $PROX >> $WITCH/config.txt #3rd line
  31. $WITCH/color.sh QUESTION "finally are you an ub0r l33t? [y/n] we give ub0r l33ts the supreme choice to intervene (not yet implemeneted :P)"
  32. read INTERVENE
  33. echo $INTERVENE >> $WITCH/config.txt #4th line
  34. }
  35. menu() {
  36. clear
  37. $WITCH/color.sh QUESTION "what do you want to do?"
  38. $WITCH/color.sh GREEN "
  39. A. write iso of current operating system (rewic)
  40. B. install a new operating system (cauldren)
  41. C. do it all yourself
  42. Q. quit because you don't want to listen to us anymore"
  43. read WITCHCRAFTMODE
  44. case $WITCHCRAFTMODE in
  45. A|a)
  46. echo "Choice was $WITCHCRAFTMODE. sorry, this part of the script is still under construction. running it in a couple seconds anyway"
  47. sleep 5
  48. $WITCH/rewic.sh
  49. ;;
  50. B|b)
  51. echo "Choice was $WITCHCRAFTMODE. sorry, this part of the script is still under construction. running it in a couple seconds anyway"
  52. sleep 5
  53. $WITCH/cauldren.sh
  54. ;;
  55. C|c)
  56. echo "Choice was $WITCHCRAFTMODE. this part of the script is complete. for full manual install, simply press ctrl-C at any time to enter fully manual mode. ;)"
  57. echo "exiting to full manual mode now"
  58. exit
  59. ;;
  60. Q|q)
  61. exit
  62. ;;
  63. *)
  64. $WITCH/color.sh RED "Valid Choices are A,B,C. Don't press Q. Please."
  65. sleep 5
  66. menu
  67. ;;
  68. esac
  69. }
  70. echo ""
  71. ### time to set up a nice little environmental variable
  72. export WITCH=$(pwd)
  73. #root check
  74. if [[ $EUID -ne 0 ]]
  75. then
  76. $WITCH/color.sh RED "Hmm, you don't have any root. Poor you."
  77. $WITCH/color.sh ERROR "go back and get root. before you come back."
  78. exit 1
  79. else
  80. $WITCH/color.sh RED "And you've passed thy root test! You may continue..."
  81. sleep 3
  82. fi
  83. echo
  84. questions
  85. menu