witchcraft.sh 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. #version (probably gonna keep version as "concept v0.00" until it's at least ready for a trial run.
  7. echo "VERSION: gentoo install test v0.00 " #oldversion#echo "VERSION: concept v0.00"
  8. echo "(means dont try to run it yet, for the sake of your computer. retreat while you can.)"
  9. ##dev-intro
  10. #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.
  11. echo
  12. #intro
  13. sleep 1
  14. echo "Hi, \"$USER\"."
  15. sleep 1
  16. echo "welcome to the latest incarnation of the witchcraft script."
  17. sleep 1
  18. questions() {
  19. # your native directory
  20. echo "Your native directory is... $WITCH"
  21. $WITCH/color.sh QUESTION "what is your prefered text editor? (type the name of it's executable as exists on host system):"
  22. read EDITOR
  23. echo $EDITOR > $WITCH/config.txt #1st line
  24. $WITCH/color.sh QUESTION "what is your prefered web browser? (type the name of it's executable as exists on host system):"
  25. read BROWSER
  26. echo $BROWSER >> $WITCH/config.txt #2nd line
  27. $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"
  28. read PROX
  29. echo $PROX >> $WITCH/config.txt #3rd line
  30. $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)"
  31. read INTERVENE
  32. echo $INTERVENE >> $WITCH/config.txt #4th line
  33. }
  34. menu() {
  35. clear
  36. $WITCH/color.sh QUESTION "what do you want to do?"
  37. $WITCH/color.sh GREEN "
  38. A. write iso of current operating system (rewic)
  39. B. install a new operating system (cauldren)
  40. C. do it all yourself
  41. Q. quit because you don't want to listen to us anymore"
  42. read WITCHCRAFTMODE
  43. case $WITCHCRAFTMODE in
  44. A|a)
  45. echo "Choice was $WITCHCRAFTMODE. sorry, this part of the script is still under construction. running it in a couple seconds anyway"
  46. sleep 5
  47. $WITCH/rewic.sh
  48. ;;
  49. B|b)
  50. echo "Choice was $WITCHCRAFTMODE. sorry, this part of the script is still under construction. running it in a couple seconds anyway"
  51. sleep 5
  52. $WITCH/cauldren.sh
  53. ;;
  54. C|c)
  55. 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. ;)"
  56. echo "exiting to full manual mode now"
  57. exit
  58. ;;
  59. Q|q)
  60. exit
  61. ;;
  62. *)
  63. $WITCH/color.sh RED "Valid Choices are A,B,C. Don't press Q. Please."
  64. sleep 5
  65. menu
  66. ;;
  67. esac
  68. }
  69. echo ""
  70. ### time to set up a nice little environmental variable
  71. export WITCH=$(pwd)
  72. #root check
  73. if [[ $EUID -ne 0 ]]
  74. then
  75. $WITCH/color.sh RED "Hmm, you don't have any root. Poor you."
  76. $WITCH/color.sh ERROR "go back and get root. before you come back."
  77. exit 1
  78. else
  79. $WITCH/color.sh RED "And you've passed thy root test! You may continue..."
  80. sleep 3
  81. fi
  82. echo
  83. questions
  84. if [ "$DIMG_RUN" == "true" ]; then
  85. echo "Drive IMaGe generation mode activated."
  86. $WITCH/cauldren.sh
  87. else
  88. menu
  89. fi