Explorar el Código

Domain checking for non-interactive installs

Bob Mottram hace 10 años
padre
commit
e4de79aa9d
Se han modificado 1 ficheros con 22 adiciones y 0 borrados
  1. 22
    0
      src/freedombone

+ 22
- 0
src/freedombone Ver fichero

@@ -1225,6 +1225,27 @@ function read_configuration {
1225 1225
   fi
1226 1226
 }
1227 1227
 
1228
+# check an individual domain name
1229
+function test_domain_name {
1230
+  if [ $1 ]; then
1231
+      TEST_DOMAIN_NAME=$1
1232
+      validate_domain_name
1233
+      if [[ $TEST_DOMAIN_NAME != $1 ]]; then
1234
+          echo $TEST_DOMAIN_NAME
1235
+          exit 8528
1236
+      fi
1237
+  fi
1238
+}
1239
+
1240
+# check that domain names are sensible
1241
+function check_domains {
1242
+  test_domain_name $WIKI_DOMAIN_NAME
1243
+  test_domain_name $OWNCLOUD_DOMAIN_NAME
1244
+  test_domain_name $FULLBLOG_DOMAIN_NAME
1245
+  test_domain_name $MICROBLOG_DOMAIN_NAME
1246
+  test_domain_name $REDMATRIX_DOMAIN_NAME
1247
+}
1248
+
1228 1249
 # Checks whether certificates were generated for the given hostname
1229 1250
 function check_certificates {
1230 1251
   if [ ! $1 ]; then
@@ -8697,6 +8718,7 @@ function install_final {
8697 8718
 
8698 8719
 read_configuration
8699 8720
 parse_args
8721
+check_domains
8700 8722
 install_not_on_BBB
8701 8723
 remove_default_user
8702 8724
 configure_firewall