Advertisement
Guest User

paolo/natsukao

a guest
Apr 15th, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.59 KB | None | 0 0
  1. Wargames (Thermonuclear War) from the movie
  2. By: Paolo Del Bene on Jan 23rd, 2014
  3.  
  4. #!/bin/sh -
  5.  
  6. # $OpenBSD: wargames.sh,v 1.4 2003/06/03 03:01:42 millert Exp $
  7. # $NetBSD: wargames.sh,v 1.2 1995/04/22 07:53:44 cgd Exp $
  8. # $gNewSense: wargames.sh v 1.4 2013/03/13 01:24:48 paolo del bene Exp $
  9. # $Android: wargames.sh v 1.4 2014/01/14 06:07:06 paolo del bene Exp $
  10. # $Linux Nokia 770-26 2.6.16-omap1 PREEMPT Tue Jun 20 18:38:54 EEST 2006 armv5tejl
  11. wargames.sh v 1.4 2014/01/23 11:34:02 paolo del bene Exp $
  12.  
  13. # Copyright (c) 1985, 1993
  14.  
  15. # The Regents of the University of California. All rights reserved.
  16.  
  17. #
  18.  
  19. # Redistribution and use in source and binary forms, with or without
  20.  
  21. # modification, are permitted provided that the following conditions
  22.  
  23. # are met:
  24.  
  25. # 1. Redistributions of source code must retain the above copyright
  26.  
  27. # notice, this list of conditions and the following disclaimer.
  28.  
  29. # 2. Redistributions in binary form must reproduce the above copyright
  30.  
  31. # notice, this list of conditions and the following disclaimer in the
  32.  
  33. # documentation and/or other materials provided with the distribution.
  34.  
  35. # 3. Neither the name of the University nor the names of its contributors
  36.  
  37. # may be used to endorse or promote products derived from this software
  38.  
  39. # without specific prior written permission.
  40.  
  41. #
  42.  
  43. # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  44.  
  45. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  46.  
  47. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  48.  
  49. # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  50.  
  51. # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  52.  
  53. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  54.  
  55. # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  56.  
  57. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  58.  
  59. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  60.  
  61. # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  62.  
  63. # SUCH DAMAGE.
  64.  
  65. #
  66.  
  67. # @(#)wargames.sh 8.1 (Berkeley) 5/31/93
  68.  
  69. #
  70.  
  71. echo -n "Would you like to play a game? "
  72.  
  73. read x a
  74.  
  75. x=`/usr/bin/basename $x`
  76.  
  77. if [ -f /usr/games/$x ] ; then
  78.  
  79. tput cl
  80.  
  81. exec /usr/games/$x $a
  82.  
  83. else
  84.  
  85. echo "A strange game."
  86.  
  87. echo "The only winning move is not to play."
  88.  
  89. fi
  90.  
  91. exit 0
  92.  
  93. it is necessary to create a folder with name wargames and copy the binary file in the folder wargames, i linked it on the screen and it works without problems, but the correct syntax is to put the binary file wargames in /usr/games
  94.  
  95. then you need to download the file basename in /usr/bin .
  96.  
  97. it works :
  98.  
  99. $ wargames
  100. Would you like to play a game? y
  101. A strange game.
  102. The only winning move is
  103. not to play.
  104.  
  105. On android is a little different, to use it, you need of Framaroot or similar one to gain
  106. privilegies on the mobile phone.
  107.  
  108. then you need to install busybox for your cpu which can be an Armv7; Armv9.......
  109. you need a terminal; ....
  110.  
  111. the game to start on Android must be changed in:
  112.  
  113. #!/bin/sh -
  114. # $OpenBSD: wargames.sh,v 1.4 2003/06/03 03:01:42 millert Exp $
  115. # $NetBSD: wargames.sh,v 1.2 1995/04/22 07:53:44 cgd Exp $
  116. # $gnewSense: wargames.sh, v 1.4 2013/03/13 01:24:48 paolo del bene Exp $
  117. # $Android: wargames.sh, v 1.4 2014/01/14 06:07:06 paolo del bene Exp $
  118. #
  119. # Copyright (c) 1985, 1993
  120. # The Regents of the University of California. All rights reserved.
  121. #
  122. # Redistribution and use in source and binary forms, with or without
  123. # modification, are permitted provided that the following conditions
  124. # are met:
  125. # 1. Redistributions of source code must retain the above copyright
  126. # notice, this list of conditions and the following disclaimer.
  127. # 2. Redistributions in binary form must reproduce the above copyright
  128. # notice, this list of conditions and the following disclaimer in the
  129. # documentation and/or other materials provided with the distribution.
  130. # 3. Neither the name of the University nor the names of its contributors
  131. # may be used to endorse or promote products derived from this software
  132. # without specific prior written permission.
  133. #
  134. # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  135. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  136. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  137. # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  138. # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  139. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  140. # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  141. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  142. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  143. # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  144. # SUCH DAMAGE.
  145. #
  146. # @(#)wargames.sh 8.1 (Berkeley) 5/31/93
  147. #
  148. echo -n "Would you like to play a game? "
  149. read x a
  150. x=`/storage/sdcard0/Download/basename $x`
  151.  
  152. if [ -f /storage/sdcard0/Download/$x ] ; then
  153. tput cl
  154. exec /storage/sdcard0/Download/$x $a
  155. else
  156. echo "A strange game."
  157. echo "The only winning move is not to play."
  158. fi
  159. exit 0
  160.  
  161. the file basename must be in the directory /storage/sdcard0/Download
  162. to start from shell you must to type: ash wargames and then to push the key enter and/or return
  163. the game wargames works fine but the library basename before the end of the game show a sort of error i think because initially it was developed for the CISC architecture x86.
  164.  
  165. It was ported by me on GNU/linux gNewSense and then on Android, who knows how to solve this problem, is free to release the changes to the library basename for PowerPC architecture (ARM) cpu.
  166.  
  167. On nokia 770 is a little different, after to have downloaded it, you must rename the file wargames, could happen
  168. that wargames was modified as wargames.html
  169.  
  170. you must to type mv wargames.html wargames and then push the key enter and/or return.
  171.  
  172. Files basename and wargames must be in /home/user/MyDocs/.documents
  173.  
  174. type chmod +x wargames and push the key enter and/or return
  175.  
  176. now type sh wargames and push the ey enter and/or return
  177.  
  178. you will see on the shell this message:
  179.  
  180. Would like to play a game ? y
  181. A strange game.
  182. The only winning move is not to play
  183.  
  184. happy hacking !!!!!
  185. Paolo Del Bene
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement