Browse Source

Only show syntax if needed

Bob Mottram 10 years ago
parent
commit
2d4ca25a85
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      install-freedombone.sh

+ 4
- 1
install-freedombone.sh View File

92
 fi
92
 fi
93
 
93
 
94
 function argument_checks {
94
 function argument_checks {
95
-  echo './install-freedombone.sh [domain] [username] [subdomain code]'
95
+  SYNTAX='./install-freedombone.sh [domain] [username] [subdomain code]'
96
   echo ''
96
   echo ''
97
   if [ ! -d /home/$MY_USERNAME ]; then
97
   if [ ! -d /home/$MY_USERNAME ]; then
98
 	  echo "There is no user '$MY_USERNAME' on the system. Use 'adduser $MY_USERNAME' to create the user."
98
 	  echo "There is no user '$MY_USERNAME' on the system. Use 'adduser $MY_USERNAME' to create the user."
99
 	  exit 1
99
 	  exit 1
100
   fi
100
   fi
101
   if [ ! $DOMAIN_NAME ]; then
101
   if [ ! $DOMAIN_NAME ]; then
102
+	  echo $SYNTAX
102
 	  echo 'Please specify your domain name'
103
 	  echo 'Please specify your domain name'
103
 	  exit 2
104
 	  exit 2
104
   fi
105
   fi
105
   if [ ! $MY_USERNAME ]; then
106
   if [ ! $MY_USERNAME ]; then
107
+	  echo $SYNTAX
106
 	  echo 'Please specify your username'
108
 	  echo 'Please specify your username'
107
 	  exit 3
109
 	  exit 3
108
   fi
110
   fi
109
   if [ ! $FREEDNS_SUBDOMAIN_CODE ]; then
111
   if [ ! $FREEDNS_SUBDOMAIN_CODE ]; then
112
+	  echo $SYNTAX
110
       echo 'Please specify the freedns subdomain code.  To find it from '
113
       echo 'Please specify the freedns subdomain code.  To find it from '
111
       echo "https://freedns.afraid.org select 'Dynamic DNS', then 'quick "
114
       echo "https://freedns.afraid.org select 'Dynamic DNS', then 'quick "
112
       echo "cron example' and copy the code located between '?' and '=='."
115
       echo "cron example' and copy the code located between '?' and '=='."