Procházet zdrojové kódy

Beginning of interactive configuration

Bob Mottram před 10 roky
rodič
revize
ab0f358f35
1 změnil soubory, kde provedl 56 přidání a 0 odebrání
  1. 56
    0
      src/freedombone

+ 56
- 0
src/freedombone Zobrazit soubor

377
   exit 0
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
 # Oddly it appears that command line parsing cannot be done inside of a function
435
 # Oddly it appears that command line parsing cannot be done inside of a function
381
 while [[ $# > 1 ]]
436
 while [[ $# > 1 ]]
382
 do
437
 do
531
 esac
586
 esac
532
 shift
587
 shift
533
 done
588
 done
589
+fi
534
 
590
 
535
 function parse_args {
591
 function parse_args {
536
   if [[ $NO_OF_ARGS == 0 ]]; then
592
   if [[ $NO_OF_ARGS == 0 ]]; then