Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1.
- #!/bin/sh -
- 2.
- # $OpenBSD: wargames.sh,v 1.4 2003/06/03 03:01:42 millert Exp $
- 3.
- # $NetBSD: wargames.sh,v 1.2 1995/04/22 07:53:44 cgd Exp $
- 4.
- # $gNewSense: wargames.sh v 1.4 2013/03/13 01:24:48 paolo del bene Exp $
- 5.
- # $Android: wargames.sh v 1.4 2014/01/14 06:07:06 paolo del bene Exp $
- 6.
- # Copyright (c) 1985, 1993
- 7.
- # The Regents of the University of California. All rights reserved.
- 8.
- #
- 9.
- # Redistribution and use in source and binary forms, with or without
- 10.
- # modification, are permitted provided that the following conditions
- 11.
- # are met:
- 12.
- # 1. Redistributions of source code must retain the above copyright
- 13.
- # notice, this list of conditions and the following disclaimer.
- 14.
- # 2. Redistributions in binary form must reproduce the above copyright
- 15.
- # notice, this list of conditions and the following disclaimer in the
- 16.
- # documentation and/or other materials provided with the distribution.
- 17.
- # 3. Neither the name of the University nor the names of its contributors
- 18.
- # may be used to endorse or promote products derived from this software
- 19.
- # without specific prior written permission.
- 20.
- #
- 21.
- # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- 22.
- # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- 23.
- # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- 24.
- # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- 25.
- # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- 26.
- # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- 27.
- # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- 28.
- # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- 29.
- # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- 30.
- # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- 31.
- # SUCH DAMAGE.
- 32.
- #
- 33.
- # @(#)wargames.sh 8.1 (Berkeley) 5/31/93
- 34.
- #
- 35.
- echo -n "Would you like to play a game? "
- 36.
- read x a
- 37.
- x=`/usr/bin/basename $x`
- 38.
- 39.
- if [ -f /usr/games/$x ] ; then
- 40.
- tput cl
- 41.
- exec /usr/games/$x $a
- 42.
- else
- 43.
- echo "A strange game."
- 44.
- echo "The only winning move is not to play."
- 45.
- fi
- 46.
- exit 0
- 47.
- 48.
- 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
- 49.
- then you need to download the file basename in /usr/bin .
- 50.
- 51. it works :
- 52.
- 53.$ wargames
- 54. Would you like to play a game? y
- 55. A strange game.
- 56. The only winning move is
- 57. not to play.
- 58.
- 59. On android is a little different, to use it, you need of Framaroot or similar one to gain
- 60. privilegies on the mobile phone.
- 61. then you need to install busybox for your cpu which can be an Armv7; Armv9.......
- 62. you need a terminal; ....
- 63. the game to start on Android must be changed in:
- 64. #!/bin/sh -
- 65. # $OpenBSD: wargames.sh,v 1.4 2003/06/03 03:01:42 millert Exp $
- 66. # $NetBSD: wargames.sh,v 1.2 1995/04/22 07:53:44 cgd Exp $
- 67. # $gnewSense: wargames.sh, v 1.4 2013/03/13 01:24:48 paolo del bene Exp $
- 68. # $Android: wargames.sh, v 1.4 2014/01/14 06:07:06 paolo del bene Exp $
- 69. #
- 70. # Copyright (c) 1985, 1993
- 71. # The Regents of the University of California. All rights reserved.
- 72. #
- 73. # Redistribution and use in source and binary forms, with or without
- 74. # modification, are permitted provided that the following conditions
- 75. # are met:
- 76. # 1. Redistributions of source code must retain the above copyright
- 77. # notice, this list of conditions and the following disclaimer.
- 78. # 2. Redistributions in binary form must reproduce the above copyright
- 79. # notice, this list of conditions and the following disclaimer in the
- 80. # documentation and/or other materials provided with the distribution.
- 81. # 3. Neither the name of the University nor the names of its contributors
- 82. # may be used to endorse or promote products derived from this software
- 83. # without specific prior written permission.
- 84. #
- 85. # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- 86. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- 87. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- 88. # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- 89. # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- 90. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- 91. # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- 92. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- 93. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- 94. # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- 95. # SUCH DAMAGE.
- 96. #
- 97. # @(#)wargames.sh 8.1 (Berkeley) 5/31/93
- 98. #
- 99. echo -n "Would you like to play a game? "
- 100. read x a
- 101. x=`/storage/sdcard0/Download/basename $x`
- 102.
- 103. if [ -f /storage/sdcard0/Download/$x ] ; then
- 104. tput cl
- 105. exec /storage/sdcard0/Download/$x $a
- 106. else
- 107. echo "A strange game."
- 108. echo "The only winning move is not to play."
- 109. fi
- 110. exit 0
- 111. the file basename must be in the directory /storage/sdcard0/Download
- 112. to start from shell you must to type: ash wargames and then to push the key enter and/or return
- 113. the game wargames works fine but the library basename before the end of the game show a sort of
- 114. error i think because initially it was developed for the CISC architecture x86.
- 115. It was ported by me on GNU/linux gNewSense and then on Android, who knows how to solve this problem,
- 116. is free to release the changes to the library basename for PowerPC architecture (ARM) cpu.
- 117. happy hacking !!!!!
- 118. Paolo Del Bene
Add Comment
Please, Sign In to add comment