Selaa lähdekoodia

Beginning of interactive configuration

Bob Mottram 10 vuotta sitten
vanhempi
commit
ab0f358f35
1 muutettua tiedostoa jossa 56 lisäystä ja 0 poistoa
  1. 56
    0
      src/freedombone

+ 56
- 0
src/freedombone Näytä tiedosto

@@ -377,6 +377,61 @@ function show_help {
377 377
   exit 0
378 378
 }
379 379
 
380
+function interactive_configuration {
381
+  dialog --title "Install Target" \
382
+      --backtitle "Freedombone Configuration" \
383
+      --defaultno \
384
+      --yesno "\nAre you installing onto a Beaglebone Black?" 7 60
385
+  sel=$?
386
+  echo "Result $sel"
387
+  case $sel in
388
+      0) INSTALLING_ON_BBB="yes";;
389
+      1) INSTALLING_ON_BBB="no";;
390
+      255) exit 0;;
391
+  esac
392
+
393
+  dialog --backtitle "Freedombone Configuration" \
394
+      --checklist "Choose Dynamic DNS provider:" 15 40 14 \
395
+      1 dyndns off \
396
+      2 freedns on \
397
+      3 zoneedit off \
398
+      4 no-ip off \
399
+      5 easydns off \
400
+      6 tzo off \
401
+      7 3322 off \
402
+      8 dnsomatic off \
403
+      9 tunnelbroker off \
404
+      10 dns.he.net off \
405
+      11 dynsip off \
406
+      12 sitelutions off \
407
+      13 dnsexit off \
408
+      14 changeip off
409
+  sel=$?
410
+  case $sel in
411
+      1) DDNS_PROVIDER="default@dyndns.org";;
412
+      2) DDNS_PROVIDER="default@freedns.afraid.org";;
413
+      3) DDNS_PROVIDER="default@zoneedit.com";;
414
+      4) DDNS_PROVIDER="default@no-ip.com";;
415
+      5) DDNS_PROVIDER="default@easydns.com";;
416
+      6) DDNS_PROVIDER="default@tzo.com";;
417
+      7) DDNS_PROVIDER="dyndns@3322.org";;
418
+      8) DDNS_PROVIDER="default@dnsomatic.com";;
419
+      9) DDNS_PROVIDER="ipv6tb@he.net";;
420
+      10) DDNS_PROVIDER="dyndns@he.net";;
421
+      11) DDNS_PROVIDER="default@dynsip.org";;
422
+      12) DDNS_PROVIDER="default@sitelutions.com";;
423
+      13) DDNS_PROVIDER="default@dnsexit.com";;
424
+      14) DDNS_PROVIDER="default@changeip.com";;
425
+      255) exit 0;;
426
+  esac
427
+
428
+  exit 0
429
+}
430
+
431
+if [[ $1 == "menuconfig" ]]; then
432
+    interactive_configuration
433
+else
434
+
380 435
 # Oddly it appears that command line parsing cannot be done inside of a function
381 436
 while [[ $# > 1 ]]
382 437
 do
@@ -531,6 +586,7 @@ case $key in
531 586
 esac
532 587
 shift
533 588
 done
589
+fi
534 590
 
535 591
 function parse_args {
536 592
   if [[ $NO_OF_ARGS == 0 ]]; then