mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

172 lines
5.1 KiB

  1. #!/bin/bash
  2. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  3. #
  4. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  5. # Please add additional copyright information _after_ the line containing
  6. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  7. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  8. #
  9. # ROCK Linux: rock-src/target/lvp/x86/release_skeleton/config.sh
  10. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  11. #
  12. # This program is free software; you can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; either version 2 of the License, or
  15. # (at your option) any later version. A copy of the GNU General Public
  16. # License can be found at Documentation/COPYING.
  17. #
  18. # Many people helped and are helping developing ROCK Linux. Please
  19. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  20. # file for details.
  21. #
  22. # --- ROCK-COPYRIGHT-NOTE-END ---
  23. . scripts/functions
  24. [ -e .config ] && . .config
  25. read a b lvp_ver < VERSION
  26. oldcount=${LVP_COUNTME:-0}
  27. quit=0
  28. while [ "${quit}" == "0" ] ; do
  29. menu_init
  30. . scripts/configuration
  31. clear
  32. display
  33. read -p "Enter your choice> " choice
  34. case "${choice}" in
  35. q)
  36. quit=1
  37. ;;
  38. s)
  39. save
  40. ;;
  41. l)
  42. load
  43. ;;
  44. c)
  45. save
  46. scripts/create_lvp
  47. if [ ${LVP_COUNTME} -eq 1 ] ; then
  48. read id a < <( ( cpuid 2>/dev/null ; hostid 2>/dev/null ; cat /etc/passwd ) | md5sum )
  49. program="`which curl`"
  50. if [ -z "${program}" ] ; then
  51. program="`which wget`"
  52. if [ -z "${program}" ] ; then
  53. echo "Can't find either curl or wget. Not counting this disk."
  54. else
  55. program="${program} -O - -o /dev/null http://lvp.crash-override.net/count.php?id=${id}"
  56. fi
  57. else
  58. program="${program} http://lvp.crash-override.net/count.php?id=${id} 2>/dev/null"
  59. fi
  60. ${program}
  61. fi
  62. read -p "Press -<enter>- to continue"
  63. ;;
  64. x)
  65. scripts/cleanup
  66. read -p "Press -<enter>- to continue"
  67. ;;
  68. i)
  69. scripts/create_iso
  70. read -p "Press -<enter>- to continue"
  71. ;;
  72. w)
  73. clear
  74. cat <<-EOF
  75. NO WARRANTY
  76. 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
  77. FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
  78. OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
  79. PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
  80. OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  81. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
  82. TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
  83. PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
  84. REPAIR OR CORRECTION.
  85. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  86. WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
  87. REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
  88. INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
  89. OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
  90. TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
  91. YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  92. PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
  93. POSSIBILITY OF SUCH DAMAGES.
  94. EOF
  95. read -p "Press -<enter>- to continue"
  96. ;;
  97. L)
  98. clear
  99. more=$( which more )
  100. ${more:-cat} COPYING
  101. read -p "Press -<enter>- to continue"
  102. ;;
  103. m)
  104. clear
  105. cat <<-EOF
  106. If you want to make the author of this software happy, drop him a line:
  107. blindcoder@scavenger.homeip.net
  108. Or support him:
  109. http://lvp.crash-override.net/support.html
  110. Either way, you'll make a simple programmer very happy :-)
  111. EOF
  112. read -p "Press -<enter>- to continue"
  113. ;;
  114. u)
  115. program="`which curl`"
  116. if [ -z "${program}" ] ; then
  117. program="`which wget`"
  118. if [ -z "${program}" ] ; then
  119. echo "Can't find either curl or wget. Please check"
  120. echo
  121. echo " http://lvp.crash-override.net/latest.txt"
  122. echo
  123. echo "manually for an update."
  124. else
  125. program="${program} -O - http://lvp.crash-override.net/latest.txt"
  126. fi
  127. else
  128. program="${program} http://lvp.crash-override.net/latest.txt"
  129. fi
  130. read new_ver url < <( ${program} 2>/dev/null )
  131. if [ "${lvp_ver}" != "${new_ver}" ] ; then
  132. echo "New version LVP V${new_ver} is available! Download it at"
  133. echo "${url}"
  134. echo
  135. else
  136. echo "You already have the latest version."
  137. echo
  138. fi
  139. read -p "Press -<enter>- to continue"
  140. ;;
  141. *)
  142. get ${choice}
  143. if [ "${LVP_COUNTME}" == "1" -a "${oldcount}" == "0" ] ; then
  144. read id a < <( ( cpuid 2>/dev/null ; hostid 2>/dev/null ; cat /etc/passwd ) | md5sum )
  145. cat <<-EOF
  146. Thank you for deciding to have your disks counted!
  147. To prevent abuse of the counter a semi-unique ID is sent to the server
  148. when counting. Your ID is this:
  149. ${id}
  150. EOF
  151. olddefault=${LVP_USE_DEFAULTS}
  152. LVP_USE_DEFAULTS=0
  153. confirm "Do you really want to do this"
  154. [ ${?} -eq 1 ] && LVP_COUNTME=0
  155. LVP_USE_DEFAULTS=${olddefault}
  156. fi
  157. oldcount=${LVP_COUNTME}
  158. ;;
  159. esac
  160. done