Browse Source

Rename cjdns related things in preparation for multiple mesh types

Bob Mottram 9 years ago
parent
commit
249d9b0f2e
1 changed files with 17 additions and 17 deletions
  1. 17
    17
      src/freedombone

+ 17
- 17
src/freedombone View File

@@ -1187,8 +1187,8 @@ function get_cjdns_password {
1187 1187
   fi
1188 1188
 }
1189 1189
 
1190
-function install_cjdns {
1191
-  if grep -Fxq "install_cjdns" $COMPLETION_FILE; then
1190
+function mesh_cjdns {
1191
+  if grep -Fxq "mesh_cjdns" $COMPLETION_FILE; then
1192 1192
       return
1193 1193
   fi
1194 1194
   if [[ $ENABLE_CJDNS != "yes" ]]; then
@@ -1396,9 +1396,9 @@ function install_cjdns {
1396 1396
       exit 4395
1397 1397
   fi
1398 1398
 
1399
-  if ! grep -q "# Mesh network" /etc/network/interfaces; then
1399
+  if ! grep -q "# Mesh network cjdns" /etc/network/interfaces; then
1400 1400
       echo '' >> /etc/network/interfaces
1401
-      echo '# Mesh network' >> /etc/network/interfaces
1401
+      echo '# Mesh Networking (cjdns)' >> /etc/network/interfaces
1402 1402
       echo 'iface eth0 inet6 static' >> /etc/network/interfaces
1403 1403
       echo '    pre-up modprobe ipv6' >> /etc/network/interfaces
1404 1404
       echo '    address fdfc:0000:0000:0000:0000:0000:0000:0001' >> /etc/network/interfaces
@@ -1414,13 +1414,13 @@ function install_cjdns {
1414 1414
   ip6tables -A INPUT -i eth0 -p tcp --dport $CJDNS_PORT -j ACCEPT
1415 1415
   save_firewall_settings
1416 1416
 
1417
-  if ! grep -q "Mesh Networking" /home/$MY_USERNAME/README; then
1417
+  if ! grep -q "Mesh Networking (cjdns)" /home/$MY_USERNAME/README; then
1418 1418
       CURRENT_IP_ADDRESS=$(ip addr show | grep "inet " | sed -n 2p | awk -F ' ' '{print $2}' | awk -F '/' '{print $1}')
1419 1419
 
1420 1420
       echo '' >> /home/$MY_USERNAME/README
1421 1421
       echo '' >> /home/$MY_USERNAME/README
1422
-      echo 'Mesh Networking' >> /home/$MY_USERNAME/README
1423
-      echo '===============' >> /home/$MY_USERNAME/README
1422
+      echo 'Mesh Networking (cjdns)' >> /home/$MY_USERNAME/README
1423
+      echo '=======================' >> /home/$MY_USERNAME/README
1424 1424
       echo "cjdns IPv6 address: $CJDNS_IPV6" >> /home/$MY_USERNAME/README
1425 1425
       echo "cjdns public key: $CJDNS_PUBLIC_KEY" >> /home/$MY_USERNAME/README
1426 1426
       echo "cjdns private key: $CJDNS_PRIVATE_KEY" >> /home/$MY_USERNAME/README
@@ -1455,18 +1455,18 @@ function install_cjdns {
1455 1455
       chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
1456 1456
   fi
1457 1457
 
1458
-  echo 'install_cjdns' >> $COMPLETION_FILE
1458
+  echo 'mesh_cjdns' >> $COMPLETION_FILE
1459 1459
 }
1460 1460
 
1461
-function install_cjdns_tools {
1462
-  if grep -Fxq "install_cjdns_tools" $COMPLETION_FILE; then
1461
+function mesh_cjdns_tools {
1462
+  if grep -Fxq "mesh_cjdns_tools" $COMPLETION_FILE; then
1463 1463
       return
1464 1464
   fi
1465 1465
   if [[ $ENABLE_CJDNS != "yes" ]]; then
1466 1466
       return
1467 1467
   fi
1468 1468
   if [ ! -d /etc/cjdns ]; then
1469
-      install_cjdns
1469
+      mesh_cjdns
1470 1470
   fi
1471 1471
 
1472 1472
   apt-get -y install golang mercurial
@@ -1492,7 +1492,7 @@ function install_cjdns_tools {
1492 1492
   # initialise from the cjdns config
1493 1493
   /usr/bin/cjdcmd cjdnsadmin -file /etc/cjdns/cjdroute.conf
1494 1494
 
1495
-  echo 'install_cjdns_tools' >> $COMPLETION_FILE
1495
+  echo 'mesh_cjdns_tools' >> $COMPLETION_FILE
1496 1496
 }
1497 1497
 
1498 1498
 function remove_instructions_from_motd {
@@ -1859,7 +1859,7 @@ function create_backup_script {
1859 1859
       echo 'fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
1860 1860
       echo '' >> /usr/bin/$BACKUP_SCRIPT_NAME
1861 1861
   fi
1862
-  if grep -Fxq "install_cjdns" $COMPLETION_FILE; then
1862
+  if grep -Fxq "mesh_cjdns" $COMPLETION_FILE; then
1863 1863
       echo "if [ ! -d $USB_MOUNT/backup/cjdns ]; then" >> /usr/bin/$BACKUP_SCRIPT_NAME
1864 1864
       echo "  mkdir -p $USB_MOUNT/backup/cjdns" >> /usr/bin/$BACKUP_SCRIPT_NAME
1865 1865
       echo 'fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
@@ -3296,7 +3296,7 @@ function backup_to_friends_servers {
3296 3296
       echo 'fi' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
3297 3297
       echo '' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
3298 3298
   fi
3299
-  if grep -Fxq "install_cjdns" $COMPLETION_FILE; then
3299
+  if grep -Fxq "mesh_cjdns" $COMPLETION_FILE; then
3300 3300
       echo 'if [ ! -d $SERVER_DIRECTORY/backup/cjdns ]; then' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
3301 3301
       echo '  mkdir -p $SERVER_DIRECTORY/backup/cjdns' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
3302 3302
       echo 'fi' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
@@ -8798,7 +8798,7 @@ function create_upgrade_script {
8798 8798
       echo 'git stash drop' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
8799 8799
       echo 'git pull' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
8800 8800
   fi
8801
-  if grep -Fxq "install_cjdns" $COMPLETION_FILE; then
8801
+  if grep -Fxq "mesh_cjdns" $COMPLETION_FILE; then
8802 8802
       echo '' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
8803 8803
       echo '# cjdns' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
8804 8804
       echo "cd /etc/cjdns" >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
@@ -9240,8 +9240,8 @@ set_your_domain_name
9240 9240
 time_synchronisation
9241 9241
 configure_internet_protocol
9242 9242
 create_git_project
9243
-install_cjdns
9244
-install_cjdns_tools
9243
+mesh_cjdns
9244
+mesh_cjdns_tools
9245 9245
 backup_github_projects
9246 9246
 configure_ssh
9247 9247
 remove_instructions_from_motd