Просмотр исходного кода

Check number of arguments when installing to microsd

Bob Mottram 10 лет назад
Родитель
Сommit
1364ea3298
1 измененных файлов: 11 добавлений и 0 удалений
  1. 11
    0
      src/freedombone-prep

+ 11
- 0
src/freedombone-prep Просмотреть файл

20
 # You should have received a copy of the GNU General Public License
20
 # You should have received a copy of the GNU General Public License
21
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22
 
22
 
23
+# The number of arguments
24
+NO_OF_ARGS=$#
25
+
23
 # Version number of this script
26
 # Version number of this script
24
 VERSION="1.00"
27
 VERSION="1.00"
25
 
28
 
45
     echo ''
48
     echo ''
46
     echo 'freedombone-prep -d [microSD device] --ip [BBB LAN IP address] --iprouter [Router LAN IP address]'
49
     echo 'freedombone-prep -d [microSD device] --ip [BBB LAN IP address] --iprouter [Router LAN IP address]'
47
     echo ''
50
     echo ''
51
+    echo 'See the manpage for more details'
52
+    echo ''
48
 }
53
 }
49
 
54
 
55
+# if no arguments are given
56
+if [[ $NO_OF_ARGS == 0 ]]; then
57
+  show_help
58
+  exit 0
59
+fi
60
+
50
 while [[ $# > 1 ]]
61
 while [[ $# > 1 ]]
51
 do
62
 do
52
 key="$1"
63
 key="$1"