Browse Source

Function name is an array

Bob Mottram 7 years ago
parent
commit
443d7a7913
45 changed files with 234 additions and 232 deletions
  1. 2
    2
      src/freedombone-app-batman
  2. 4
    4
      src/freedombone-app-dlna
  3. 4
    4
      src/freedombone-app-ipfs
  4. 1
    1
      src/freedombone-app-irc
  5. 1
    1
      src/freedombone-app-keyserver
  6. 2
    2
      src/freedombone-app-mumble
  7. 2
    2
      src/freedombone-app-rss
  8. 2
    2
      src/freedombone-app-syncthing
  9. 4
    4
      src/freedombone-app-tox
  10. 2
    2
      src/freedombone-app-xmpp
  11. 2
    2
      src/freedombone-app-zeronet
  12. 35
    35
      src/freedombone-base-email
  13. 2
    2
      src/freedombone-base-tripwire
  14. 58
    56
      src/freedombone-utils-avahi
  15. 2
    2
      src/freedombone-utils-backup
  16. 2
    2
      src/freedombone-utils-cmake
  17. 2
    2
      src/freedombone-utils-cron
  18. 2
    2
      src/freedombone-utils-cryptopp
  19. 4
    4
      src/freedombone-utils-database
  20. 8
    8
      src/freedombone-utils-dns
  21. 2
    2
      src/freedombone-utils-filesystem
  22. 2
    2
      src/freedombone-utils-final
  23. 14
    14
      src/freedombone-utils-firewall
  24. 2
    2
      src/freedombone-utils-git
  25. 1
    1
      src/freedombone-utils-go
  26. 2
    2
      src/freedombone-utils-international
  27. 2
    2
      src/freedombone-utils-login
  28. 2
    2
      src/freedombone-utils-mongodb
  29. 2
    2
      src/freedombone-utils-monkeysphere
  30. 2
    2
      src/freedombone-utils-network
  31. 2
    2
      src/freedombone-utils-nodejs
  32. 10
    10
      src/freedombone-utils-onion
  33. 2
    2
      src/freedombone-utils-passwords
  34. 2
    2
      src/freedombone-utils-postgresql
  35. 4
    4
      src/freedombone-utils-repos
  36. 4
    4
      src/freedombone-utils-rng
  37. 6
    6
      src/freedombone-utils-setup
  38. 8
    8
      src/freedombone-utils-ssh
  39. 2
    2
      src/freedombone-utils-tracker
  40. 4
    4
      src/freedombone-utils-upgrade
  41. 2
    2
      src/freedombone-utils-watchdog
  42. 8
    8
      src/freedombone-utils-web
  43. 5
    5
      src/freedombone-utils-wifi
  44. 2
    2
      src/freedombone-utils-zram
  45. 1
    1
      src/freedombone-zram

+ 2
- 2
src/freedombone-app-batman View File

53
 }
53
 }
54
 
54
 
55
 function configure_firewall_for_batman {
55
 function configure_firewall_for_batman {
56
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
56
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
57
         return
57
         return
58
     fi
58
     fi
59
     if [[ $ENABLE_BATMAN != "yes" ]]; then
59
     if [[ $ENABLE_BATMAN != "yes" ]]; then
62
 
62
 
63
     function_check save_firewall_settings
63
     function_check save_firewall_settings
64
     save_firewall_settings
64
     save_firewall_settings
65
-    mark_completed $FUNCNAME
65
+    mark_completed "${FUNCNAME[0]}"
66
 }
66
 }
67
 
67
 
68
 function reconfigure_batman {
68
 function reconfigure_batman {

+ 4
- 4
src/freedombone-app-dlna View File

84
 }
84
 }
85
 
85
 
86
 function configure_firewall_for_dlna {
86
 function configure_firewall_for_dlna {
87
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
87
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
88
         return
88
         return
89
     fi
89
     fi
90
     if [[ $INSTALLED_WITHIN_DOCKER == "yes" ]]; then
90
     if [[ $INSTALLED_WITHIN_DOCKER == "yes" ]]; then
111
 
111
 
112
     systemctl restart avahi-daemon
112
     systemctl restart avahi-daemon
113
 
113
 
114
-    mark_completed $FUNCNAME
114
+    mark_completed "${FUNCNAME[0]}"
115
 }
115
 }
116
 
116
 
117
 function backup_local_dlna {
117
 function backup_local_dlna {
253
 }
253
 }
254
 
254
 
255
 function script_for_attaching_usb_drive {
255
 function script_for_attaching_usb_drive {
256
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
256
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
257
         return
257
         return
258
     fi
258
     fi
259
     echo '#!/bin/bash' > /usr/bin/attach-music
259
     echo '#!/bin/bash' > /usr/bin/attach-music
289
     echo 'exit 0' >> /usr/bin/remove-music
289
     echo 'exit 0' >> /usr/bin/remove-music
290
     chmod +x /usr/bin/remove-music
290
     chmod +x /usr/bin/remove-music
291
 
291
 
292
-    mark_completed $FUNCNAME
292
+    mark_completed "${FUNCNAME[0]}"
293
 }
293
 }
294
 
294
 
295
 function install_dlna {
295
 function install_dlna {

+ 4
- 4
src/freedombone-app-ipfs View File

205
 }
205
 }
206
 
206
 
207
 function configure_firewall_for_ipfs {
207
 function configure_firewall_for_ipfs {
208
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
208
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
209
         return
209
         return
210
     fi
210
     fi
211
     if [[ $ONION_ONLY != "no" ]]; then
211
     if [[ $ONION_ONLY != "no" ]]; then
213
     fi
213
     fi
214
 
214
 
215
     firewall_add IPFS $IPFS_PORT tcp
215
     firewall_add IPFS $IPFS_PORT tcp
216
-    mark_completed $FUNCNAME
216
+    mark_completed "${FUNCNAME[0]}"
217
 }
217
 }
218
 
218
 
219
 function mesh_install_ipfs_js {
219
 function mesh_install_ipfs_js {
220
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
220
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
221
         return
221
         return
222
     fi
222
     fi
223
 
223
 
287
 
287
 
288
     chroot ${rootdir} systemctl enable ${IPFS_DAEMON_NAME}
288
     chroot ${rootdir} systemctl enable ${IPFS_DAEMON_NAME}
289
 
289
 
290
-    mark_completed $FUNCNAME
290
+    mark_completed "${FUNCNAME[0]}"
291
 }
291
 }
292
 
292
 
293
 function install_ipfs_js {
293
 function install_ipfs_js {

+ 1
- 1
src/freedombone-app-irc View File

481
     if [ ! -d /etc/ngircd ]; then
481
     if [ ! -d /etc/ngircd ]; then
482
         return
482
         return
483
     fi
483
     fi
484
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
484
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
485
         return
485
         return
486
     fi
486
     fi
487
     if [[ ${INSTALLED_WITHIN_DOCKER} == "yes" ]]; then
487
     if [[ ${INSTALLED_WITHIN_DOCKER} == "yes" ]]; then

+ 1
- 1
src/freedombone-app-keyserver View File

102
     firewall_add keyserver 11370 tcp
102
     firewall_add keyserver 11370 tcp
103
     firewall_add keyserver 11371 tcp
103
     firewall_add keyserver 11371 tcp
104
     firewall_add keyserver 11372 tcp
104
     firewall_add keyserver 11372 tcp
105
-    mark_completed $FUNCNAME
105
+    mark_completed "${FUNCNAME[0]}"
106
 }
106
 }
107
 
107
 
108
 function keyserver_reset_database {
108
 function keyserver_reset_database {

+ 2
- 2
src/freedombone-app-mumble View File

225
 }
225
 }
226
 
226
 
227
 function configure_firewall_for_mumble {
227
 function configure_firewall_for_mumble {
228
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
228
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
229
         return
229
         return
230
     fi
230
     fi
231
     if [[ $ONION_ONLY != "no" ]]; then
231
     if [[ $ONION_ONLY != "no" ]]; then
232
         return
232
         return
233
     fi
233
     fi
234
     firewall_add Mumble ${MUMBLE_PORT}
234
     firewall_add Mumble ${MUMBLE_PORT}
235
-    mark_completed $FUNCNAME
235
+    mark_completed "${FUNCNAME[0]}"
236
 }
236
 }
237
 
237
 
238
 function install_mumble {
238
 function install_mumble {

+ 2
- 2
src/freedombone-app-rss View File

604
     set_repo_commit $RSS_READER_GNUSOCIAL_PATH "rss reader gnusocial commit" "$RSS_READER_GNUSOCIAL_COMMIT" $RSS_READER_GNUSOCIAL_REPO
604
     set_repo_commit $RSS_READER_GNUSOCIAL_PATH "rss reader gnusocial commit" "$RSS_READER_GNUSOCIAL_COMMIT" $RSS_READER_GNUSOCIAL_REPO
605
     chown -R www-data:www-data $RSS_READER_GNUSOCIAL_PATH
605
     chown -R www-data:www-data $RSS_READER_GNUSOCIAL_PATH
606
 
606
 
607
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
607
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
608
         return
608
         return
609
     fi
609
     fi
610
 
610
 
648
         fi
648
         fi
649
     fi
649
     fi
650
 
650
 
651
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
651
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
652
         return
652
         return
653
     fi
653
     fi
654
 
654
 

+ 2
- 2
src/freedombone-app-syncthing View File

512
 }
512
 }
513
 
513
 
514
 function configure_firewall_for_syncthing {
514
 function configure_firewall_for_syncthing {
515
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
515
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
516
         return
516
         return
517
     fi
517
     fi
518
 
518
 
519
     firewall_add Syncthing ${SYNCTHING_PORT}
519
     firewall_add Syncthing ${SYNCTHING_PORT}
520
-    mark_completed $FUNCNAME
520
+    mark_completed "${FUNCNAME[0]}"
521
 }
521
 }
522
 
522
 
523
 function install_syncthing_repo {
523
 function install_syncthing_repo {

+ 4
- 4
src/freedombone-app-tox View File

318
 
318
 
319
 function configure_firewall_for_tox {
319
 function configure_firewall_for_tox {
320
     if [ ! $INSTALLING_MESH ]; then
320
     if [ ! $INSTALLING_MESH ]; then
321
-        if [[ $(is_completed $FUNCNAME) == "1" ]]; then
321
+        if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
322
             return
322
             return
323
         fi
323
         fi
324
     fi
324
     fi
341
     fi
341
     fi
342
 
342
 
343
     firewall_add Tox ${TOX_PORT}
343
     firewall_add Tox ${TOX_PORT}
344
-    mark_completed $FUNCNAME
344
+    mark_completed "${FUNCNAME[0]}"
345
 }
345
 }
346
 
346
 
347
 function tox_avahi {
347
 function tox_avahi {
348
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
348
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
349
         return
349
         return
350
     fi
350
     fi
351
 
351
 
387
 
387
 
388
     systemctl restart avahi-daemon
388
     systemctl restart avahi-daemon
389
 
389
 
390
-    mark_completed $FUNCNAME
390
+    mark_completed "${FUNCNAME[0]}"
391
 }
391
 }
392
 
392
 
393
 function install_tox_node {
393
 function install_tox_node {

+ 2
- 2
src/freedombone-app-xmpp View File

573
     if [ ! -d /etc/prosody ]; then
573
     if [ ! -d /etc/prosody ]; then
574
         return
574
         return
575
     fi
575
     fi
576
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
576
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
577
         return
577
         return
578
     fi
578
     fi
579
     if [[ $INSTALLED_WITHIN_DOCKER == "yes" ]]; then
579
     if [[ $INSTALLED_WITHIN_DOCKER == "yes" ]]; then
588
     firewall_add XMPP 5269 tcp
588
     firewall_add XMPP 5269 tcp
589
     firewall_add XMPP 5280 tcp
589
     firewall_add XMPP 5280 tcp
590
     firewall_add XMPP 5281 tcp
590
     firewall_add XMPP 5281 tcp
591
-    mark_completed $FUNCNAME
591
+    mark_completed "${FUNCNAME[0]}"
592
 }
592
 }
593
 
593
 
594
 function remove_xmpp {
594
 function remove_xmpp {

+ 2
- 2
src/freedombone-app-zeronet View File

140
 }
140
 }
141
 
141
 
142
 function configure_firewall_for_zeronet {
142
 function configure_firewall_for_zeronet {
143
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
143
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
144
         return
144
         return
145
     fi
145
     fi
146
     firewall_add ZeroNet ${ZERONET_PORT}
146
     firewall_add ZeroNet ${ZERONET_PORT}
147
     firewall_add Tracker ${TRACKER_PORT}
147
     firewall_add Tracker ${TRACKER_PORT}
148
     firewall_add Tracker 1900 udp
148
     firewall_add Tracker 1900 udp
149
-    mark_completed $FUNCNAME
149
+    mark_completed "${FUNCNAME[0]}"
150
 }
150
 }
151
 
151
 
152
 function install_zeronet_blog {
152
 function install_zeronet_blog {

+ 35
- 35
src/freedombone-base-email View File

120
 }
120
 }
121
 
121
 
122
 function configure_email_onion {
122
 function configure_email_onion {
123
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
123
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
124
         return
124
         return
125
     fi
125
     fi
126
     if [[ $SYSTEM_TYPE == "mesh"* ]]; then
126
     if [[ $SYSTEM_TYPE == "mesh"* ]]; then
150
     set_completion_param "email onion domain" "${onion_address}"
150
     set_completion_param "email onion domain" "${onion_address}"
151
     add_email_hostname "$onion_address"
151
     add_email_hostname "$onion_address"
152
 
152
 
153
-    mark_completed $FUNCNAME
153
+    mark_completed "${FUNCNAME[0]}"
154
 }
154
 }
155
 
155
 
156
 function check_email_address_exists {
156
 function check_email_address_exists {
207
     function_check set_repo_commit
207
     function_check set_repo_commit
208
     set_repo_commit $INSTALL_DIR/gpgit "gpgit commit" "$GPGIT_COMMIT" $GPGIT_REPO
208
     set_repo_commit $INSTALL_DIR/gpgit "gpgit commit" "$GPGIT_COMMIT" $GPGIT_REPO
209
 
209
 
210
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
210
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
211
         return
211
         return
212
     fi
212
     fi
213
 
213
 
237
         echo -n '| /usr/bin/gpgit.pl --encrypt-mode prefer-inline --inline-flatten $USER@' >> /etc/skel/.procmailrc
237
         echo -n '| /usr/bin/gpgit.pl --encrypt-mode prefer-inline --inline-flatten $USER@' >> /etc/skel/.procmailrc
238
         echo "$DEFAULT_DOMAIN_NAME" >> /etc/skel/.procmailrc
238
         echo "$DEFAULT_DOMAIN_NAME" >> /etc/skel/.procmailrc
239
     fi
239
     fi
240
-    mark_completed $FUNCNAME
240
+    mark_completed "${FUNCNAME[0]}"
241
 }
241
 }
242
 
242
 
243
 function encrypt_outgoing_email {
243
 function encrypt_outgoing_email {
247
     if [ ! -d /etc/exim4 ]; then
247
     if [ ! -d /etc/exim4 ]; then
248
         return
248
         return
249
     fi
249
     fi
250
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
250
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
251
         return
251
         return
252
     fi
252
     fi
253
     if [[ $GPG_ENCRYPT_STORED_EMAIL != "yes" ]]; then
253
     if [[ $GPG_ENCRYPT_STORED_EMAIL != "yes" ]]; then
287
         sed -i "s|set pgp_encrypt_sign_command.*|set pgp_encrypt_sign_command=\"/usr/lib/mutt/pgpewrap gpg %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --trust-model always --encrypt-to $MY_GPG_PUBLIC_KEY_ID -- -r %r -- %f\"|g" /home/$MY_USERNAME/.muttrc
287
         sed -i "s|set pgp_encrypt_sign_command.*|set pgp_encrypt_sign_command=\"/usr/lib/mutt/pgpewrap gpg %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --trust-model always --encrypt-to $MY_GPG_PUBLIC_KEY_ID -- -r %r -- %f\"|g" /home/$MY_USERNAME/.muttrc
288
     fi
288
     fi
289
 
289
 
290
-    mark_completed $FUNCNAME
290
+    mark_completed "${FUNCNAME[0]}"
291
 }
291
 }
292
 
292
 
293
 function encrypt_all_email {
293
 function encrypt_all_email {
320
         fi
320
         fi
321
     fi
321
     fi
322
 
322
 
323
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
323
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
324
         return
324
         return
325
     fi
325
     fi
326
 
326
 
343
         chmod 600 /home/$MY_USERNAME/README
343
         chmod 600 /home/$MY_USERNAME/README
344
     fi
344
     fi
345
 
345
 
346
-    mark_completed $FUNCNAME
346
+    mark_completed "${FUNCNAME[0]}"
347
 }
347
 }
348
 
348
 
349
 function email_client {
349
 function email_client {
350
     if [ ! -d /etc/exim4 ]; then
350
     if [ ! -d /etc/exim4 ]; then
351
         return
351
         return
352
     fi
352
     fi
353
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
353
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
354
         return
354
         return
355
     fi
355
     fi
356
     apt-get -yq install lynx abook urlview mutt
356
     apt-get -yq install lynx abook urlview mutt
475
         chown ${GENERIC_IMAGE_USERNAME}:${GENERIC_IMAGE_USERNAME} /home/${GENERIC_IMAGE_USERNAME}/.mutt-alias
475
         chown ${GENERIC_IMAGE_USERNAME}:${GENERIC_IMAGE_USERNAME} /home/${GENERIC_IMAGE_USERNAME}/.mutt-alias
476
     fi
476
     fi
477
 
477
 
478
-    mark_completed $FUNCNAME
478
+    mark_completed "${FUNCNAME[0]}"
479
 }
479
 }
480
 
480
 
481
 function email_archiving {
481
 function email_archiving {
519
     function_check set_repo_commit
519
     function_check set_repo_commit
520
     set_repo_commit $INSTALL_DIR/cleanup-maildir "cleanup-maildir commit" "$CLEANUP_MAILDIR_COMMIT" $CLEANUP_MAILDIR_REPO
520
     set_repo_commit $INSTALL_DIR/cleanup-maildir "cleanup-maildir commit" "$CLEANUP_MAILDIR_COMMIT" $CLEANUP_MAILDIR_REPO
521
 
521
 
522
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
522
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
523
         return
523
         return
524
     fi
524
     fi
525
 
525
 
543
         fi
543
         fi
544
     fi
544
     fi
545
 
545
 
546
-    mark_completed $FUNCNAME
546
+    mark_completed "${FUNCNAME[0]}"
547
 }
547
 }
548
 
548
 
549
 # Ensure that the from field is correct when sending email from Mutt
549
 # Ensure that the from field is correct when sending email from Mutt
550
 function email_from_address {
550
 function email_from_address {
551
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
551
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
552
         return
552
         return
553
     fi
553
     fi
554
 
554
 
561
         echo "set from='$MY_NAME <$MY_EMAIL_ADDRESS>'" >> /home/$MY_USERNAME/.muttrc
561
         echo "set from='$MY_NAME <$MY_EMAIL_ADDRESS>'" >> /home/$MY_USERNAME/.muttrc
562
     fi
562
     fi
563
 
563
 
564
-    mark_completed $FUNCNAME
564
+    mark_completed "${FUNCNAME[0]}"
565
 }
565
 }
566
 
566
 
567
 function create_public_mailing_list {
567
 function create_public_mailing_list {
568
     if [ ! -d /etc/exim4 ]; then
568
     if [ ! -d /etc/exim4 ]; then
569
         return
569
         return
570
     fi
570
     fi
571
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
571
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
572
         return
572
         return
573
     fi
573
     fi
574
     if [ ! $PUBLIC_MAILING_LIST ]; then
574
     if [ ! $PUBLIC_MAILING_LIST ]; then
658
 
658
 
659
     ${PROJECT_NAME}-addlist -u $MY_USERNAME -l "$PUBLIC_MAILING_LIST" -s "$PUBLIC_MAILING_LIST"
659
     ${PROJECT_NAME}-addlist -u $MY_USERNAME -l "$PUBLIC_MAILING_LIST" -s "$PUBLIC_MAILING_LIST"
660
 
660
 
661
-    mark_completed $FUNCNAME
661
+    mark_completed "${FUNCNAME[0]}"
662
 }
662
 }
663
 
663
 
664
 function create_private_mailing_list {
664
 function create_private_mailing_list {
665
     if [ ! -d /etc/exim4 ]; then
665
     if [ ! -d /etc/exim4 ]; then
666
         return
666
         return
667
     fi
667
     fi
668
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
668
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
669
         return
669
         return
670
     fi
670
     fi
671
     if [ ! $PRIVATE_MAILING_LIST ]; then
671
     if [ ! $PRIVATE_MAILING_LIST ]; then
720
     chmod 0000 /etc/shadow
720
     chmod 0000 /etc/shadow
721
     chmod 0000 /etc/gshadow
721
     chmod 0000 /etc/gshadow
722
     #exim -d -bt $PRIVATE_MAILING_LIST@$DEFAULT_DOMAIN_NAME
722
     #exim -d -bt $PRIVATE_MAILING_LIST@$DEFAULT_DOMAIN_NAME
723
-    mark_completed $FUNCNAME
723
+    mark_completed "${FUNCNAME[0]}"
724
 }
724
 }
725
 
725
 
726
 function split_gpg_key_into_fragments {
726
 function split_gpg_key_into_fragments {
753
       Now on your internet router forward ports
753
       Now on your internet router forward ports
754
      25, 587, 465, 993 and 2222 to the ${PROJECT_NAME}
754
      25, 587, 465, 993 and 2222 to the ${PROJECT_NAME}
755
 "
755
 "
756
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
756
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
757
         if [[ $SYSTEM_TYPE == "mail"* ]]; then
757
         if [[ $SYSTEM_TYPE == "mail"* ]]; then
758
             function_check backup_to_friends_servers
758
             function_check backup_to_friends_servers
759
             backup_to_friends_servers
759
             backup_to_friends_servers
776
         fi
776
         fi
777
         return
777
         return
778
     fi
778
     fi
779
-    mark_completed $FUNCNAME
779
+    mark_completed "${FUNCNAME[0]}"
780
     if [[ $SYSTEM_TYPE == "mail"* ]]; then
780
     if [[ $SYSTEM_TYPE == "mail"* ]]; then
781
         function_check backup_to_friends_servers
781
         function_check backup_to_friends_servers
782
         backup_to_friends_servers
782
         backup_to_friends_servers
886
     if [ ! -d /etc/exim4 ]; then
886
     if [ ! -d /etc/exim4 ]; then
887
         return
887
         return
888
     fi
888
     fi
889
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
889
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
890
         return
890
         return
891
     fi
891
     fi
892
     if [ ! -f /home/$MY_USERNAME/.procmailrc ]; then
892
     if [ ! -f /home/$MY_USERNAME/.procmailrc ]; then
924
         chmod 6755 /usr/bin/procmail
924
         chmod 6755 /usr/bin/procmail
925
     fi
925
     fi
926
 
926
 
927
-    mark_completed $FUNCNAME
927
+    mark_completed "${FUNCNAME[0]}"
928
 }
928
 }
929
 
929
 
930
 function handle_admin_emails {
930
 function handle_admin_emails {
940
     if [ ! -d /etc/exim4 ]; then
940
     if [ ! -d /etc/exim4 ]; then
941
         return
941
         return
942
     fi
942
     fi
943
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
943
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
944
         return
944
         return
945
     fi
945
     fi
946
     apt-get -yq install exim4-daemon-heavy
946
     apt-get -yq install exim4-daemon-heavy
1109
     function_check cron_add_mins
1109
     function_check cron_add_mins
1110
     cron_add_mins 10 "$script_name 2> /dev/null"
1110
     cron_add_mins 10 "$script_name 2> /dev/null"
1111
 
1111
 
1112
-    mark_completed $FUNCNAME
1112
+    mark_completed "${FUNCNAME[0]}"
1113
 }
1113
 }
1114
 
1114
 
1115
 function configure_imap {
1115
 function configure_imap {
1116
     if [ ! -d /etc/exim4 ]; then
1116
     if [ ! -d /etc/exim4 ]; then
1117
         return
1117
         return
1118
     fi
1118
     fi
1119
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
1119
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
1120
         return
1120
         return
1121
     fi
1121
     fi
1122
 
1122
 
1213
     fi
1213
     fi
1214
 
1214
 
1215
     systemctl restart dovecot
1215
     systemctl restart dovecot
1216
-    mark_completed $FUNCNAME
1216
+    mark_completed "${FUNCNAME[0]}"
1217
 }
1217
 }
1218
 
1218
 
1219
 function configure_imap_client_certs {
1219
 function configure_imap_client_certs {
1220
     if [ ! -d /etc/exim4 ]; then
1220
     if [ ! -d /etc/exim4 ]; then
1221
         return
1221
         return
1222
     fi
1222
     fi
1223
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
1223
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
1224
         return
1224
         return
1225
     fi
1225
     fi
1226
     # http://strange.systems/certificate-based-auth-with-dovecot-sendmail/
1226
     # http://strange.systems/certificate-based-auth-with-dovecot-sendmail/
1295
     echo 0001 > /etc/ssl/sslserial
1295
     echo 0001 > /etc/ssl/sslserial
1296
     #${PROJECT_NAME}-clientcert -u $MY_USERNAME
1296
     #${PROJECT_NAME}-clientcert -u $MY_USERNAME
1297
     systemctl restart dovecot
1297
     systemctl restart dovecot
1298
-    mark_completed $FUNCNAME
1298
+    mark_completed "${FUNCNAME[0]}"
1299
 }
1299
 }
1300
 
1300
 
1301
 function create_gpg_subkey {
1301
 function create_gpg_subkey {
1303
     if [ ! -d /etc/exim4 ]; then
1303
     if [ ! -d /etc/exim4 ]; then
1304
         return
1304
         return
1305
     fi
1305
     fi
1306
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
1306
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
1307
         return
1307
         return
1308
     fi
1308
     fi
1309
     apt-get -yq install gnupg
1309
     apt-get -yq install gnupg
1336
 
1336
 
1337
     MY_GPG_SUBKEY_ID=$(gpg_pubkey_from_email "$MY_USERNAME" "$MY_EMAIL_ADDRESS")
1337
     MY_GPG_SUBKEY_ID=$(gpg_pubkey_from_email "$MY_USERNAME" "$MY_EMAIL_ADDRESS")
1338
 
1338
 
1339
-    mark_completed $FUNCNAME
1339
+    mark_completed "${FUNCNAME[0]}"
1340
 }
1340
 }
1341
 
1341
 
1342
 function gpg_key_exists {
1342
 function gpg_key_exists {
1362
     if [ ! -d /etc/exim4 ]; then
1362
     if [ ! -d /etc/exim4 ]; then
1363
         return
1363
         return
1364
     fi
1364
     fi
1365
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
1365
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
1366
         return
1366
         return
1367
     fi
1367
     fi
1368
     apt-get -yq install gnupg dirmngr
1368
     apt-get -yq install gnupg dirmngr
1395
                 if [ -d /home/$MY_USERNAME/.gnupg/crls.d ]; then
1395
                 if [ -d /home/$MY_USERNAME/.gnupg/crls.d ]; then
1396
                     chmod +x /home/$MY_USERNAME/.gnupg/crls.d
1396
                     chmod +x /home/$MY_USERNAME/.gnupg/crls.d
1397
                 fi
1397
                 fi
1398
-                mark_completed $FUNCNAME
1398
+                mark_completed "${FUNCNAME[0]}"
1399
                 return
1399
                 return
1400
             fi
1400
             fi
1401
         fi
1401
         fi
1481
         fi
1481
         fi
1482
     fi
1482
     fi
1483
 
1483
 
1484
-    mark_completed $FUNCNAME
1484
+    mark_completed "${FUNCNAME[0]}"
1485
 }
1485
 }
1486
 
1486
 
1487
 function refresh_gpg_keys {
1487
 function refresh_gpg_keys {
1525
     if [[ $SYSTEM_TYPE == "mesh"* ]]; then
1525
     if [[ $SYSTEM_TYPE == "mesh"* ]]; then
1526
         return
1526
         return
1527
     fi
1527
     fi
1528
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
1528
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
1529
         return
1529
         return
1530
     fi
1530
     fi
1531
 
1531
 
1533
     install_email_basic
1533
     install_email_basic
1534
     configure_email_onion
1534
     configure_email_onion
1535
 
1535
 
1536
-    mark_completed $FUNCNAME
1536
+    mark_completed "${FUNCNAME[0]}"
1537
 }
1537
 }
1538
 
1538
 
1539
 # NOTE: deliberately no exit 0
1539
 # NOTE: deliberately no exit 0

+ 2
- 2
src/freedombone-base-tripwire View File

49
 }
49
 }
50
 
50
 
51
 function install_tripwire {
51
 function install_tripwire {
52
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
52
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
53
         return
53
         return
54
     fi
54
     fi
55
 
55
 
146
 
146
 
147
        ' | twadmin --create-polfile -S /etc/tripwire/${HOSTNAME}-site.key /etc/tripwire/twpol.txt
147
        ' | twadmin --create-polfile -S /etc/tripwire/${HOSTNAME}-site.key /etc/tripwire/twpol.txt
148
 
148
 
149
-    mark_completed $FUNCNAME
149
+    mark_completed "${FUNCNAME[0]}"
150
 }
150
 }
151
 
151
 
152
 # NOTE: deliberately no exit 0
152
 # NOTE: deliberately no exit 0

+ 58
- 56
src/freedombone-utils-avahi View File

40
         exit 52925
40
         exit 52925
41
     fi
41
     fi
42
 
42
 
43
-    echo '<?xml version="1.0" standalone="no"?><!--*-nxml-*-->' > /etc/avahi/services/${service_name}.service
44
-    echo '<!DOCTYPE service-group SYSTEM "avahi-service.dtd">' >> /etc/avahi/services/${service_name}.service
45
-    echo '<service-group>' >> /etc/avahi/services/${service_name}.service
46
-    echo "  <name replace-wildcards=\"yes\">%h ${service_type}</name>" >> /etc/avahi/services/${service_name}.service
47
-    echo '  <service>' >> /etc/avahi/services/${service_name}.service
48
-    echo "    <type>_${service_type}._${service_protocol}</type>" >> /etc/avahi/services/${service_name}.service
49
-    echo "    <port>${service_port}</port>" >> /etc/avahi/services/${service_name}.service
43
+    { echo '<?xml version="1.0" standalone="no"?><!--*-nxml-*-->';
44
+      echo '<!DOCTYPE service-group SYSTEM "avahi-service.dtd">';
45
+      echo '<service-group>';
46
+      echo "  <name replace-wildcards=\"yes\">%h ${service_type}</name>";
47
+      echo '  <service>';
48
+      echo "    <type>_${service_type}._${service_protocol}</type>";
49
+      echo "    <port>${service_port}</port>"; }  > "/etc/avahi/services/${service_name}.service"
50
+
50
     if [ "$service_description" ]; then
51
     if [ "$service_description" ]; then
51
-        echo "    <txt-record>$service_description</txt-record>" >> /etc/avahi/services/${service_name}.service
52
+        echo "    <txt-record>$service_description</txt-record>" >> "/etc/avahi/services/${service_name}.service"
52
     fi
53
     fi
53
-    echo '  </service>' >> /etc/avahi/services/${service_name}.service
54
-    echo '</service-group>' >> /etc/avahi/services/${service_name}.service
54
+
55
+    { echo '  </service>';
56
+      echo '</service-group>'; } >> "/etc/avahi/services/${service_name}.service"
55
 }
57
 }
56
 
58
 
57
 function mesh_avahi {
59
 function mesh_avahi {
59
 
61
 
60
     decarray=( 1 2 3 4 5 6 7 8 9 0 )
62
     decarray=( 1 2 3 4 5 6 7 8 9 0 )
61
     PEER_ID=${decarray[$RANDOM%10]}${decarray[$RANDOM%10]}${decarray[$RANDOM%10]}${decarray[$RANDOM%10]}${decarray[$RANDOM%10]}${decarray[$RANDOM%10]}${decarray[$RANDOM%10]}${decarray[$RANDOM%10]}
63
     PEER_ID=${decarray[$RANDOM%10]}${decarray[$RANDOM%10]}${decarray[$RANDOM%10]}${decarray[$RANDOM%10]}${decarray[$RANDOM%10]}${decarray[$RANDOM%10]}${decarray[$RANDOM%10]}${decarray[$RANDOM%10]}
62
-    sed -i "s|#host-name=.*|host-name=P$PEER_ID|g" $rootdir/etc/avahi/avahi-daemon.conf
63
-    sed -i "s|use-ipv4=.*|use-ipv4=no|g" $rootdir/etc/avahi/avahi-daemon.conf
64
-    sed -i "s|use-ipv6=.*|use-ipv6=yes|g" $rootdir/etc/avahi/avahi-daemon.conf
65
-    sed -i "s|#allow-interfaces=.*|allow-interfaces=wlan0, wlan1, wlan2, wlan3, wlan4, wlan5|g" $rootdir/etc/avahi/avahi-daemon.conf
66
-    sed -i "s|allow-interfaces=.*|allow-interfaces=wlan0, wlan1, wlan2, wlan3, wlan4, wlan5|g" $rootdir/etc/avahi/avahi-daemon.conf
67
-    sed -i "s|#deny-interfaces=.*|deny-interfaces=eth0, eth1, eth2, eth3, eth4, eth5|g" $rootdir/etc/avahi/avahi-daemon.conf
68
-    sed -i "s|deny-interfaces=.*|deny-interfaces=eth0, eth1, eth2, eth3, eth4, eth5|g" $rootdir/etc/avahi/avahi-daemon.conf
69
-    sed -i "s|#disallow-other-stacks=.*|disallow-other-stacks=yes|g" $rootdir/etc/avahi/avahi-daemon.conf
70
-    sed -i "s|disallow-other-stacks=.*|disallow-other-stacks=yes|g" $rootdir/etc/avahi/avahi-daemon.conf
71
-    sed -i "s|#publish_addresses=.*|publish_addresses=yes|g" $rootdir/etc/avahi/avahi-daemon.conf
72
-    sed -i "s|publish_addresses=.*|publish_addresses=yes|g" $rootdir/etc/avahi/avahi-daemon.conf
73
-    sed -i "s|#publish-hinfo=.*|publish-hinfo=no|g" $rootdir/etc/avahi/avahi-daemon.conf
74
-    sed -i "s|publish-hinfo=.*|publish-hinfo=no|g" $rootdir/etc/avahi/avahi-daemon.conf
75
-    sed -i "s|#publish-workstation=.*|publish-workstation=no|g" $rootdir/etc/avahi/avahi-daemon.conf
76
-    sed -i "s|publish-workstation=.*|publish-workstation=no|g" $rootdir/etc/avahi/avahi-daemon.conf
77
-    sed -i "s|#publish-domain=.*|publish-domain=yes|g" $rootdir/etc/avahi/avahi-daemon.conf
78
-    sed -i "s|publish-domain=.*|publish-domain=yes|g" $rootdir/etc/avahi/avahi-daemon.conf
79
-    sed -i "s|#publish-a-on-ipv6=.*|publish-a-on-ipv6=yes|g" $rootdir/etc/avahi/avahi-daemon.conf
80
-    sed -i "s|publish-a-on-ipv6=.*|publish-a-on-ipv6=yes|g" $rootdir/etc/avahi/avahi-daemon.conf
81
-
82
-    if [ ! -d $rootdir/etc/avahi/services ]; then
83
-        mkdir -p $rootdir/etc/avahi/services
64
+    sed -i "s|#host-name=.*|host-name=P$PEER_ID|g" "$rootdir/etc/avahi/avahi-daemon.conf"
65
+    sed -i "s|use-ipv4=.*|use-ipv4=no|g" "$rootdir/etc/avahi/avahi-daemon.conf"
66
+    sed -i "s|use-ipv6=.*|use-ipv6=yes|g" "$rootdir/etc/avahi/avahi-daemon.conf"
67
+    sed -i "s|#allow-interfaces=.*|allow-interfaces=wlan0, wlan1, wlan2, wlan3, wlan4, wlan5|g" "$rootdir/etc/avahi/avahi-daemon.conf"
68
+    sed -i "s|allow-interfaces=.*|allow-interfaces=wlan0, wlan1, wlan2, wlan3, wlan4, wlan5|g" "$rootdir/etc/avahi/avahi-daemon.conf"
69
+    sed -i "s|#deny-interfaces=.*|deny-interfaces=eth0, eth1, eth2, eth3, eth4, eth5|g" "$rootdir/etc/avahi/avahi-daemon.conf"
70
+    sed -i "s|deny-interfaces=.*|deny-interfaces=eth0, eth1, eth2, eth3, eth4, eth5|g" "$rootdir/etc/avahi/avahi-daemon.conf"
71
+    sed -i "s|#disallow-other-stacks=.*|disallow-other-stacks=yes|g" "$rootdir/etc/avahi/avahi-daemon.conf"
72
+    sed -i "s|disallow-other-stacks=.*|disallow-other-stacks=yes|g" "$rootdir/etc/avahi/avahi-daemon.conf"
73
+    sed -i "s|#publish_addresses=.*|publish_addresses=yes|g" "$rootdir/etc/avahi/avahi-daemon.conf"
74
+    sed -i "s|publish_addresses=.*|publish_addresses=yes|g" "$rootdir/etc/avahi/avahi-daemon.conf"
75
+    sed -i "s|#publish-hinfo=.*|publish-hinfo=no|g" "$rootdir/etc/avahi/avahi-daemon.conf"
76
+    sed -i "s|publish-hinfo=.*|publish-hinfo=no|g" "$rootdir/etc/avahi/avahi-daemon.conf"
77
+    sed -i "s|#publish-workstation=.*|publish-workstation=no|g" "$rootdir/etc/avahi/avahi-daemon.conf"
78
+    sed -i "s|publish-workstation=.*|publish-workstation=no|g" "$rootdir/etc/avahi/avahi-daemon.conf"
79
+    sed -i "s|#publish-domain=.*|publish-domain=yes|g" "$rootdir/etc/avahi/avahi-daemon.conf"
80
+    sed -i "s|publish-domain=.*|publish-domain=yes|g" "$rootdir/etc/avahi/avahi-daemon.conf"
81
+    sed -i "s|#publish-a-on-ipv6=.*|publish-a-on-ipv6=yes|g" "$rootdir/etc/avahi/avahi-daemon.conf"
82
+    sed -i "s|publish-a-on-ipv6=.*|publish-a-on-ipv6=yes|g" "$rootdir/etc/avahi/avahi-daemon.conf"
83
+
84
+    if [ ! -d "$rootdir/etc/avahi/services" ]; then
85
+        mkdir -p "$rootdir/etc/avahi/services"
84
     fi
86
     fi
85
 
87
 
86
     # remove an avahi service which isn't used
88
     # remove an avahi service which isn't used
87
-    if [ -f $rootdir/etc/avahi/services/udisks.service ]; then
88
-        rm $rootdir/etc/avahi/services/udisks.service
89
+    if [ -f "$rootdir/etc/avahi/services/udisks.service" ]; then
90
+        rm "$rootdir/etc/avahi/services/udisks.service"
89
     fi
91
     fi
90
 
92
 
91
     # Add a mesh routing protocol service
93
     # Add a mesh routing protocol service
92
-    echo '<?xml version="1.0" standalone="no"?><!--*-nxml-*-->' > $rootdir/etc/avahi/services/routing.service
93
-    echo '<!DOCTYPE service-group SYSTEM "avahi-service.dtd">' >> $rootdir/etc/avahi/services/routing.service
94
-    echo '<service-group>' >> $rootdir/etc/avahi/services/routing.service
95
-    echo '  <name replace-wildcards="yes">%h routing</name>' >> $rootdir/etc/avahi/services/routing.service
96
-    echo '  <service>' >> $rootdir/etc/avahi/services/routing.service
97
-    echo '    <type>_bmx6._tcp</type>' >> $rootdir/etc/avahi/services/routing.service
98
-    echo '  </service>' >> $rootdir/etc/avahi/services/routing.service
99
-    echo '</service-group>' >> $rootdir/etc/avahi/services/routing.service
94
+    { echo '<?xml version="1.0" standalone="no"?><!--*-nxml-*-->';
95
+      echo '<!DOCTYPE service-group SYSTEM "avahi-service.dtd">';
96
+      echo '<service-group>';
97
+      echo '  <name replace-wildcards="yes">%h routing</name>';
98
+      echo '  <service>';
99
+      echo '    <type>_bmx6._tcp</type>';
100
+      echo '  </service>';
101
+      echo '</service-group>'; } > "$rootdir/etc/avahi/services/routing.service"
100
 
102
 
101
     # keep the daemon running
103
     # keep the daemon running
102
     WATCHDOG_SCRIPT_NAME="keepon"
104
     WATCHDOG_SCRIPT_NAME="keepon"
103
-    echo '' >> $rootdir/usr/bin/$WATCHDOG_SCRIPT_NAME
104
-    echo '# keep avahi daemon running' >> $rootdir/usr/bin/$WATCHDOG_SCRIPT_NAME
105
-    echo 'AVAHI_RUNNING=$(pgrep avahi-daemon > /dev/null && echo Running)' >> $rootdir/usr/bin/$WATCHDOG_SCRIPT_NAME
106
-    echo 'if [ ! $AVAHI_RUNNING ]; then' >> $rootdir/usr/bin/$WATCHDOG_SCRIPT_NAME
107
-    echo '  systemctl start avahi-daemon' >> $rootdir/usr/bin/$WATCHDOG_SCRIPT_NAME
108
-    echo '  echo -n $CURRENT_DATE >> $LOGFILE' >> $rootdir/usr/bin/$WATCHDOG_SCRIPT_NAME
109
-    echo '  echo " Avahi daemon restarted" >> $LOGFILE' >> $rootdir/usr/bin/$WATCHDOG_SCRIPT_NAME
110
-    echo 'fi' >> $rootdir/usr/bin/$WATCHDOG_SCRIPT_NAME
111
-    chmod +x $rootdir/usr/bin/$WATCHDOG_SCRIPT_NAME
105
+    { echo '';
106
+      echo '# keep avahi daemon running';
107
+      echo "AVAHI_RUNNING=\$(pgrep avahi-daemon > /dev/null && echo Running)";
108
+      echo "if [ ! \$AVAHI_RUNNING ]; then";
109
+      echo '  systemctl start avahi-daemon';
110
+      echo "  echo -n \$CURRENT_DATE >> \$LOGFILE";
111
+      echo "  echo \" Avahi daemon restarted\" >> \$LOGFILE";
112
+      echo 'fi'; } >> "$rootdir/usr/bin/$WATCHDOG_SCRIPT_NAME"
113
+    chmod +x "$rootdir/usr/bin/$WATCHDOG_SCRIPT_NAME"
112
 }
114
 }
113
 
115
 
114
 function install_avahi {
116
 function install_avahi {
115
-    if [ $INSTALLING_MESH ]; then
117
+    if [ "$INSTALLING_MESH" ]; then
116
         mesh_avahi
118
         mesh_avahi
117
         return
119
         return
118
     fi
120
     fi
119
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
121
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
120
         return
122
         return
121
     fi
123
     fi
122
     # only enable avahi if we're doing mesh networking
124
     # only enable avahi if we're doing mesh networking
140
         sed -i "s|host-name=.*|host-name=P$PEER_ID|g" /etc/avahi/avahi-daemon.conf
142
         sed -i "s|host-name=.*|host-name=P$PEER_ID|g" /etc/avahi/avahi-daemon.conf
141
     fi
143
     fi
142
 
144
 
143
-    mark_completed $FUNCNAME
145
+    mark_completed "${FUNCNAME[0]}"
144
 }
146
 }
145
 
147
 
146
 function configure_firewall_for_avahi {
148
 function configure_firewall_for_avahi {
147
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
149
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
148
         return
150
         return
149
     fi
151
     fi
150
     iptables -A INPUT -p tcp --dport 548 -j ACCEPT
152
     iptables -A INPUT -p tcp --dport 548 -j ACCEPT
155
     iptables -A INPUT -p udp --dport 5354 -j ACCEPT
157
     iptables -A INPUT -p udp --dport 5354 -j ACCEPT
156
     function_check save_firewall_settings
158
     function_check save_firewall_settings
157
     save_firewall_settings
159
     save_firewall_settings
158
-    mark_completed $FUNCNAME
160
+    mark_completed "${FUNCNAME[0]}"
159
 }
161
 }
160
 
162
 
161
 # NOTE: deliberately there is no "exit 0"
163
 # NOTE: deliberately there is no "exit 0"

+ 2
- 2
src/freedombone-utils-backup View File

67
 }
67
 }
68
 
68
 
69
 function configure_backup_key {
69
 function configure_backup_key {
70
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
70
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
71
         return
71
         return
72
     fi
72
     fi
73
     apt-get -yq install gnupg dirmngr
73
     apt-get -yq install gnupg dirmngr
132
     shred -zu ${MY_BACKUP_KEY}_public.asc
132
     shred -zu ${MY_BACKUP_KEY}_public.asc
133
     shred -zu ${MY_BACKUP_KEY}_private.asc
133
     shred -zu ${MY_BACKUP_KEY}_private.asc
134
 
134
 
135
-    mark_completed $FUNCNAME
135
+    mark_completed "${FUNCNAME[0]}"
136
 }
136
 }
137
 
137
 
138
 function backup_to_friends_servers {
138
 function backup_to_friends_servers {

+ 2
- 2
src/freedombone-utils-cmake View File

83
         fi
83
         fi
84
     fi
84
     fi
85
 
85
 
86
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
86
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
87
         return
87
         return
88
     fi
88
     fi
89
 
89
 
111
     fi
111
     fi
112
     make install
112
     make install
113
 
113
 
114
-    mark_completed $FUNCNAME
114
+    mark_completed "${FUNCNAME[0]}"
115
 }
115
 }
116
 
116
 
117
 # NOTE: deliberately there is no "exit 0"
117
 # NOTE: deliberately there is no "exit 0"

+ 2
- 2
src/freedombone-utils-cron View File

43
     # The predictable default timing of Debian cron jobs might
43
     # The predictable default timing of Debian cron jobs might
44
     # be exploitable knowledge. Avoid too much predictability
44
     # be exploitable knowledge. Avoid too much predictability
45
     # by randomizing the times when cron jobs run
45
     # by randomizing the times when cron jobs run
46
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
46
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
47
         return
47
         return
48
     fi
48
     fi
49
 
49
 
74
 
74
 
75
     systemctl restart cron
75
     systemctl restart cron
76
 
76
 
77
-    mark_completed $FUNCNAME
77
+    mark_completed "${FUNCNAME[0]}"
78
 }
78
 }
79
 
79
 
80
 function schedule_stig_tests {
80
 function schedule_stig_tests {

+ 2
- 2
src/freedombone-utils-cryptopp View File

76
         fi
76
         fi
77
     fi
77
     fi
78
 
78
 
79
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
79
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
80
         return
80
         return
81
     fi
81
     fi
82
 
82
 
98
     fi
98
     fi
99
     make install
99
     make install
100
 
100
 
101
-    mark_completed $FUNCNAME
101
+    mark_completed "${FUNCNAME[0]}"
102
 }
102
 }
103
 
103
 
104
 # NOTE: deliberately there is no "exit 0"
104
 # NOTE: deliberately there is no "exit 0"

+ 4
- 4
src/freedombone-utils-database View File

191
 }
191
 }
192
 
192
 
193
 function install_mariadb {
193
 function install_mariadb {
194
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
194
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
195
         return
195
         return
196
     fi
196
     fi
197
     apt-get -yq install software-properties-common debconf-utils
197
     apt-get -yq install software-properties-common debconf-utils
237
 
237
 
238
     mariadb_create_root_user
238
     mariadb_create_root_user
239
 
239
 
240
-    mark_completed $FUNCNAME
240
+    mark_completed "${FUNCNAME[0]}"
241
 }
241
 }
242
 
242
 
243
 function backup_databases_script_header {
243
 function backup_databases_script_header {
285
         sed -i "s|/usr/bin/repairdatabase|${PROJECT_NAME}-repair-database|g" /etc/cron.hourly/repair
285
         sed -i "s|/usr/bin/repairdatabase|${PROJECT_NAME}-repair-database|g" /etc/cron.hourly/repair
286
     fi
286
     fi
287
 
287
 
288
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
288
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
289
         return
289
         return
290
     fi
290
     fi
291
 
291
 
299
     chmod 600 /etc/cron.hourly/repair
299
     chmod 600 /etc/cron.hourly/repair
300
     chmod +x /etc/cron.hourly/repair
300
     chmod +x /etc/cron.hourly/repair
301
 
301
 
302
-    mark_completed $FUNCNAME
302
+    mark_completed "${FUNCNAME[0]}"
303
 }
303
 }
304
 
304
 
305
 function remove_database {
305
 function remove_database {

+ 8
- 8
src/freedombone-utils-dns View File

102
     fi
102
     fi
103
 
103
 
104
     # currently inadyn doesn't work as expected with freeDNS, so this is a workaround
104
     # currently inadyn doesn't work as expected with freeDNS, so this is a workaround
105
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
105
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
106
         return
106
         return
107
     fi
107
     fi
108
     if [[ $DDNS_PROVIDER != *"freedns"* ]]; then
108
     if [[ $DDNS_PROVIDER != *"freedns"* ]]; then
127
         systemctl restart cron
127
         systemctl restart cron
128
     fi
128
     fi
129
 
129
 
130
-    mark_completed $FUNCNAME
130
+    mark_completed "${FUNCNAME[0]}"
131
 }
131
 }
132
 
132
 
133
 function add_ddns_domain {
133
 function add_ddns_domain {
192
 }
192
 }
193
 
193
 
194
 function configure_dns {
194
 function configure_dns {
195
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
195
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
196
         return
196
         return
197
     fi
197
     fi
198
 
198
 
215
     # prevent resolv.conf from changing
215
     # prevent resolv.conf from changing
216
     resolvconf -u
216
     resolvconf -u
217
 
217
 
218
-    mark_completed $FUNCNAME
218
+    mark_completed "${FUNCNAME[0]}"
219
 }
219
 }
220
 
220
 
221
 function set_hostname {
221
 function set_hostname {
233
 }
233
 }
234
 
234
 
235
 function set_your_domain_name {
235
 function set_your_domain_name {
236
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
236
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
237
         return
237
         return
238
     fi
238
     fi
239
 
239
 
240
     function_check set_hostname
240
     function_check set_hostname
241
     set_hostname $DEFAULT_DOMAIN_NAME
241
     set_hostname $DEFAULT_DOMAIN_NAME
242
 
242
 
243
-    mark_completed $FUNCNAME
243
+    mark_completed "${FUNCNAME[0]}"
244
 }
244
 }
245
 
245
 
246
 function configure_firewall_for_dns {
246
 function configure_firewall_for_dns {
247
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
247
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
248
         return
248
         return
249
     fi
249
     fi
250
     if [[ $INSTALLED_WITHIN_DOCKER == "yes" ]]; then
250
     if [[ $INSTALLED_WITHIN_DOCKER == "yes" ]]; then
254
     iptables -A INPUT -p udp -m udp --dport 1024:65535 --sport 53 -j ACCEPT
254
     iptables -A INPUT -p udp -m udp --dport 1024:65535 --sport 53 -j ACCEPT
255
     function_check save_firewall_settings
255
     function_check save_firewall_settings
256
     save_firewall_settings
256
     save_firewall_settings
257
-    mark_completed $FUNCNAME
257
+    mark_completed "${FUNCNAME[0]}"
258
 }
258
 }
259
 
259
 
260
 # NOTE: deliberately no exit 0
260
 # NOTE: deliberately no exit 0

+ 2
- 2
src/freedombone-utils-filesystem View File

70
     set_repo_commit $INSTALL_DIR/tomb "tomb commit" "$TOMB_COMMIT" $TOMB_REPO
70
     set_repo_commit $INSTALL_DIR/tomb "tomb commit" "$TOMB_COMMIT" $TOMB_REPO
71
 
71
 
72
     if [ -f $COMPLETION_FILE ]; then
72
     if [ -f $COMPLETION_FILE ]; then
73
-        if [[ $(is_completed $FUNCNAME) == "1" ]]; then
73
+        if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
74
             return
74
             return
75
         fi
75
         fi
76
     fi
76
     fi
100
         exit 93462
100
         exit 93462
101
     fi
101
     fi
102
 
102
 
103
-    mark_completed $FUNCNAME
103
+    mark_completed "${FUNCNAME[0]}"
104
 }
104
 }
105
 
105
 
106
 function defrag_filesystem {
106
 function defrag_filesystem {

+ 2
- 2
src/freedombone-utils-final View File

29
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
29
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
30
 
30
 
31
 function install_final {
31
 function install_final {
32
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
32
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
33
         return
33
         return
34
     fi
34
     fi
35
     # unmount any attached usb drive
35
     # unmount any attached usb drive
41
     split_gpg_key_into_fragments
41
     split_gpg_key_into_fragments
42
     lockdown_permissions
42
     lockdown_permissions
43
 
43
 
44
-    mark_completed $FUNCNAME
44
+    mark_completed "${FUNCNAME[0]}"
45
     clear
45
     clear
46
     echo ''
46
     echo ''
47
 
47
 

+ 14
- 14
src/freedombone-utils-firewall View File

50
     if [ $INSTALLING_MESH ]; then
50
     if [ $INSTALLING_MESH ]; then
51
         return
51
         return
52
     fi
52
     fi
53
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
53
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
54
         return
54
         return
55
     fi
55
     fi
56
 
56
 
86
     iptables -A INPUT -s 215.0.0.0/8 -j DROP
86
     iptables -A INPUT -s 215.0.0.0/8 -j DROP
87
     iptables -A OUTPUT -s 215.0.0.0/8 -j DROP
87
     iptables -A OUTPUT -s 215.0.0.0/8 -j DROP
88
     save_firewall_settings
88
     save_firewall_settings
89
-    mark_completed $FUNCNAME
89
+    mark_completed "${FUNCNAME[0]}"
90
 }
90
 }
91
 
91
 
92
 function global_rate_limit {
92
 function global_rate_limit {
143
         # recreate the firewall to remove RELATED
143
         # recreate the firewall to remove RELATED
144
         sed -i "/firewall/d" $COMPLETION_FILE
144
         sed -i "/firewall/d" $COMPLETION_FILE
145
     fi
145
     fi
146
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
146
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
147
         return
147
         return
148
     fi
148
     fi
149
     if [[ $INSTALLED_WITHIN_DOCKER == "yes" ]]; then
149
     if [[ $INSTALLED_WITHIN_DOCKER == "yes" ]]; then
200
     # Incoming malformed NULL packets:
200
     # Incoming malformed NULL packets:
201
     iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
201
     iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
202
 
202
 
203
-    mark_completed $FUNCNAME
203
+    mark_completed "${FUNCNAME[0]}"
204
 }
204
 }
205
 
205
 
206
 function firewall_drop_telnet {
206
 function firewall_drop_telnet {
207
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
207
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
208
         return
208
         return
209
     fi
209
     fi
210
     # telnet isn't enabled as an input and we can also
210
     # telnet isn't enabled as an input and we can also
213
     iptables -A OUTPUT -p udp --dport telnet -j REJECT
213
     iptables -A OUTPUT -p udp --dport telnet -j REJECT
214
     function_check save_firewall_settings
214
     function_check save_firewall_settings
215
     save_firewall_settings
215
     save_firewall_settings
216
-    mark_completed $FUNCNAME
216
+    mark_completed "${FUNCNAME[0]}"
217
 }
217
 }
218
 
218
 
219
 function configure_firewall_ping {
219
 function configure_firewall_ping {
220
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
220
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
221
         return
221
         return
222
     fi
222
     fi
223
     # Only allow ping for mesh installs
223
     # Only allow ping for mesh installs
228
     iptables -A OUTPUT -p icmp --icmp-type echo-reply -j ACCEPT
228
     iptables -A OUTPUT -p icmp --icmp-type echo-reply -j ACCEPT
229
     function_check save_firewall_settings
229
     function_check save_firewall_settings
230
     save_firewall_settings
230
     save_firewall_settings
231
-    mark_completed $FUNCNAME
231
+    mark_completed "${FUNCNAME[0]}"
232
 }
232
 }
233
 
233
 
234
 function configure_internet_protocol {
234
 function configure_internet_protocol {
235
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
235
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
236
         return
236
         return
237
     fi
237
     fi
238
     if [[ $SYSTEM_TYPE == "mesh"* ]]; then
238
     if [[ $SYSTEM_TYPE == "mesh"* ]]; then
331
         sed -i 's|net.ipv4.tcp_timestamps.*|net.ipv4.tcp_timestamps=0|g' /etc/sysctl.conf
331
         sed -i 's|net.ipv4.tcp_timestamps.*|net.ipv4.tcp_timestamps=0|g' /etc/sysctl.conf
332
     fi
332
     fi
333
     /sbin/sysctl -p
333
     /sbin/sysctl -p
334
-    mark_completed $FUNCNAME
334
+    mark_completed "${FUNCNAME[0]}"
335
 }
335
 }
336
 
336
 
337
 function mesh_firewall {
337
 function mesh_firewall {
615
 }
615
 }
616
 
616
 
617
 function firewall_drop_spoofed_packets {
617
 function firewall_drop_spoofed_packets {
618
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
618
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
619
         return
619
         return
620
     fi
620
     fi
621
     iptables -t mangle -A PREROUTING -s 224.0.0.0/3 -j DROP
621
     iptables -t mangle -A PREROUTING -s 224.0.0.0/3 -j DROP
627
     iptables -t mangle -A PREROUTING -s 127.0.0.0/8 ! -i lo -j DROP
627
     iptables -t mangle -A PREROUTING -s 127.0.0.0/8 ! -i lo -j DROP
628
     function_check save_firewall_settings
628
     function_check save_firewall_settings
629
     save_firewall_settings
629
     save_firewall_settings
630
-    mark_completed $FUNCNAME
630
+    mark_completed "${FUNCNAME[0]}"
631
 }
631
 }
632
 
632
 
633
 function firewall_rate_limits {
633
 function firewall_rate_limits {
634
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
634
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
635
         return
635
         return
636
     fi
636
     fi
637
 
637
 
652
 
652
 
653
     function_check save_firewall_settings
653
     function_check save_firewall_settings
654
     save_firewall_settings
654
     save_firewall_settings
655
-    mark_completed $FUNCNAME
655
+    mark_completed "${FUNCNAME[0]}"
656
 }
656
 }
657
 
657
 
658
 # NOTE: deliberately no exit 0
658
 # NOTE: deliberately no exit 0

+ 2
- 2
src/freedombone-utils-git View File

134
 }
134
 }
135
 
135
 
136
 function configure_firewall_for_git {
136
 function configure_firewall_for_git {
137
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
137
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
138
         return
138
         return
139
     fi
139
     fi
140
     if [[ $INSTALLED_WITHIN_DOCKER == "yes" ]]; then
140
     if [[ $INSTALLED_WITHIN_DOCKER == "yes" ]]; then
146
     fi
146
     fi
147
 
147
 
148
     firewall_add Git 9418 tcp
148
     firewall_add Git 9418 tcp
149
-    mark_completed $FUNCNAME
149
+    mark_completed "${FUNCNAME[0]}"
150
 }
150
 }
151
 
151
 
152
 # NOTE: deliberately no exit 0
152
 # NOTE: deliberately no exit 0

+ 1
- 1
src/freedombone-utils-go View File

227
         systemctl restart gogs
227
         systemctl restart gogs
228
     fi
228
     fi
229
 
229
 
230
-    set_completion_param "$FUNCNAME" "$GO_VERSION"
230
+    set_completion_param "${FUNCNAME[0]}" "$GO_VERSION"
231
 }
231
 }
232
 
232
 
233
 # NOTE: deliberately there is no "exit 0"
233
 # NOTE: deliberately there is no "exit 0"

+ 2
- 2
src/freedombone-utils-international View File

29
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
29
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
30
 
30
 
31
 function locale_setup {
31
 function locale_setup {
32
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
32
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
33
         return
33
         return
34
     fi
34
     fi
35
 
35
 
49
     update-locale LC_ALL=${DEFAULT_LANGUAGE}
49
     update-locale LC_ALL=${DEFAULT_LANGUAGE}
50
     update-locale LC_CTYPE=${DEFAULT_LANGUAGE}
50
     update-locale LC_CTYPE=${DEFAULT_LANGUAGE}
51
 
51
 
52
-    mark_completed $FUNCNAME
52
+    mark_completed "${FUNCNAME[0]}"
53
 }
53
 }
54
 
54
 
55
 # NOTE: deliberately no exit 0
55
 # NOTE: deliberately no exit 0

+ 2
- 2
src/freedombone-utils-login View File

29
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
29
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
30
 
30
 
31
 function change_login_message {
31
 function change_login_message {
32
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
32
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
33
         return
33
         return
34
     fi
34
     fi
35
 
35
 
46
     echo "'    '     --'  --'  -' -  -' '  '   -' -'   -' '   -  --'" >> /etc/motd
46
     echo "'    '     --'  --'  -' -  -' '  '   -' -'   -' '   -  --'" >> /etc/motd
47
     echo $'                  Freedom in the Cloud' >> /etc/motd
47
     echo $'                  Freedom in the Cloud' >> /etc/motd
48
     echo '' >> /etc/motd
48
     echo '' >> /etc/motd
49
-    mark_completed $FUNCNAME
49
+    mark_completed "${FUNCNAME[0]}"
50
 }
50
 }
51
 
51
 
52
 # NOTE: deliberately no exit 0
52
 # NOTE: deliberately no exit 0

+ 2
- 2
src/freedombone-utils-mongodb View File

57
         exit 7356272
57
         exit 7356272
58
     fi
58
     fi
59
 
59
 
60
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
60
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
61
         return
61
         return
62
     fi
62
     fi
63
 
63
 
90
         fi
90
         fi
91
     fi
91
     fi
92
 
92
 
93
-    mark_completed $FUNCNAME
93
+    mark_completed "${FUNCNAME[0]}"
94
 }
94
 }
95
 
95
 
96
 function remove_mongodb {
96
 function remove_mongodb {

+ 2
- 2
src/freedombone-utils-monkeysphere View File

29
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
29
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
30
 
30
 
31
 function install_monkeysphere {
31
 function install_monkeysphere {
32
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
32
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
33
         return
33
         return
34
     fi
34
     fi
35
     apt-get -yq install monkeysphere msva-perl
35
     apt-get -yq install monkeysphere msva-perl
60
     fpr=$(gpg --with-colons --fingerprint $MY_GPG_PUBLIC_KEY_ID | grep fpr | head -n 1 | awk -F ':' '{print $10}')
60
     fpr=$(gpg --with-colons --fingerprint $MY_GPG_PUBLIC_KEY_ID | grep fpr | head -n 1 | awk -F ':' '{print $10}')
61
     monkeysphere-authentication add-identity-certifier $fpr
61
     monkeysphere-authentication add-identity-certifier $fpr
62
 
62
 
63
-    mark_completed $FUNCNAME
63
+    mark_completed "${FUNCNAME[0]}"
64
 }
64
 }
65
 
65
 
66
 # NOTE: deliberately no exit 0
66
 # NOTE: deliberately no exit 0

+ 2
- 2
src/freedombone-utils-network View File

48
 MESH_INSTALL_DIR=/var/lib
48
 MESH_INSTALL_DIR=/var/lib
49
 
49
 
50
 function install_static_network {
50
 function install_static_network {
51
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
51
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
52
         return
52
         return
53
     fi
53
     fi
54
     if [[ $INSTALLING_ON_BBB == "yes" ]]; then
54
     if [[ $INSTALLING_ON_BBB == "yes" ]]; then
68
     echo '    netmask 255.255.255.0' >> /etc/network/interfaces.d/static
68
     echo '    netmask 255.255.255.0' >> /etc/network/interfaces.d/static
69
     echo "    gateway $ROUTER_IP_ADDRESS" >> /etc/network/interfaces.d/static
69
     echo "    gateway $ROUTER_IP_ADDRESS" >> /etc/network/interfaces.d/static
70
 
70
 
71
-    mark_completed $FUNCNAME
71
+    mark_completed "${FUNCNAME[0]}"
72
 }
72
 }
73
 
73
 
74
 function get_external_ipv4_address {
74
 function get_external_ipv4_address {

+ 2
- 2
src/freedombone-utils-nodejs View File

222
         mesh_install_nodejs
222
         mesh_install_nodejs
223
         return
223
         return
224
     fi
224
     fi
225
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
225
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
226
         upgrade_nodejs
226
         upgrade_nodejs
227
         return
227
         return
228
     fi
228
     fi
256
         fi
256
         fi
257
     fi
257
     fi
258
 
258
 
259
-    mark_completed $FUNCNAME
259
+    mark_completed "${FUNCNAME[0]}"
260
 }
260
 }
261
 
261
 
262
 # NOTE: deliberately there is no "exit 0"
262
 # NOTE: deliberately there is no "exit 0"

+ 10
- 10
src/freedombone-utils-onion View File

221
     if [[ $SYSTEM_TYPE == "mesh"* ]]; then
221
     if [[ $SYSTEM_TYPE == "mesh"* ]]; then
222
         return
222
         return
223
     fi
223
     fi
224
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
224
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
225
         return
225
         return
226
     fi
226
     fi
227
     apt-get -yq install tor connect-proxy
227
     apt-get -yq install tor connect-proxy
248
         echo 'Host *.onion' >> /etc/skel/.ssh/config
248
         echo 'Host *.onion' >> /etc/skel/.ssh/config
249
         echo 'ProxyCommand connect -R remote -5 -S 127.0.0.1:9050 %h %p' >> /etc/skel/.ssh/config
249
         echo 'ProxyCommand connect -R remote -5 -S 127.0.0.1:9050 %h %p' >> /etc/skel/.ssh/config
250
     fi
250
     fi
251
-    mark_completed $FUNCNAME
251
+    mark_completed "${FUNCNAME[0]}"
252
 }
252
 }
253
 
253
 
254
 function configure_ssh_onion {
254
 function configure_ssh_onion {
255
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
255
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
256
         return
256
         return
257
     fi
257
     fi
258
     if [[ $SYSTEM_TYPE == "mesh"* ]]; then
258
     if [[ $SYSTEM_TYPE == "mesh"* ]]; then
268
     set_completion_param "ssh onion domain" "${SSH_ONION_HOSTNAME}"
268
     set_completion_param "ssh onion domain" "${SSH_ONION_HOSTNAME}"
269
     add_email_hostname "${SSH_ONION_HOSTNAME}"
269
     add_email_hostname "${SSH_ONION_HOSTNAME}"
270
 
270
 
271
-    mark_completed $FUNCNAME
271
+    mark_completed "${FUNCNAME[0]}"
272
 }
272
 }
273
 
273
 
274
 function install_tor {
274
 function install_tor {
275
     if [[ $SYSTEM_TYPE == "mesh*" ]]; then
275
     if [[ $SYSTEM_TYPE == "mesh*" ]]; then
276
         return
276
         return
277
     fi
277
     fi
278
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
278
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
279
         return
279
         return
280
     fi
280
     fi
281
 
281
 
296
     sed -i "s|#AccountingMax.*|AccountingMax $TOR_MAX_TRAFFIC_PER_MONTH_GB GBytes|g" /etc/tor/torrc
296
     sed -i "s|#AccountingMax.*|AccountingMax $TOR_MAX_TRAFFIC_PER_MONTH_GB GBytes|g" /etc/tor/torrc
297
     sed -i "s|AccountingMax.*|AccountingMax $TOR_MAX_TRAFFIC_PER_MONTH_GB GBytes|g" /etc/tor/torrc
297
     sed -i "s|AccountingMax.*|AccountingMax $TOR_MAX_TRAFFIC_PER_MONTH_GB GBytes|g" /etc/tor/torrc
298
 
298
 
299
-    mark_completed $FUNCNAME
299
+    mark_completed "${FUNCNAME[0]}"
300
 }
300
 }
301
 
301
 
302
 function resolve_dns_via_tor {
302
 function resolve_dns_via_tor {
303
     if [[ $SYSTEM_TYPE == "mesh"* ]]; then
303
     if [[ $SYSTEM_TYPE == "mesh"* ]]; then
304
         return
304
         return
305
     fi
305
     fi
306
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
306
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
307
         return
307
         return
308
     fi
308
     fi
309
     if [ ! -f /etc/tor/torrc ]; then
309
     if [ ! -f /etc/tor/torrc ]; then
327
     echo 'nameserver 127.0.0.1:53' > $resolvconf
327
     echo 'nameserver 127.0.0.1:53' > $resolvconf
328
     resolvconf -u
328
     resolvconf -u
329
 
329
 
330
-    mark_completed $FUNCNAME
330
+    mark_completed "${FUNCNAME[0]}"
331
 }
331
 }
332
 
332
 
333
 # see https://trac.torproject.org/projects/tor/wiki/doc/TransparentProxy
333
 # see https://trac.torproject.org/projects/tor/wiki/doc/TransparentProxy
334
 # Local Redirection and Anonymizing Middlebox
334
 # Local Redirection and Anonymizing Middlebox
335
 function route_outgoing_traffic_through_tor {
335
 function route_outgoing_traffic_through_tor {
336
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
336
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
337
         return
337
         return
338
     fi
338
     fi
339
     if [[ $ROUTE_THROUGH_TOR != "yes" ]]; then
339
     if [[ $ROUTE_THROUGH_TOR != "yes" ]]; then
428
         echo "DNSListenAddress $LOCAL_NETWORK_STATIC_IP_ADDRESS" >> /etc/tor/torrc
428
         echo "DNSListenAddress $LOCAL_NETWORK_STATIC_IP_ADDRESS" >> /etc/tor/torrc
429
     fi
429
     fi
430
 
430
 
431
-    mark_completed $FUNCNAME
431
+    mark_completed "${FUNCNAME[0]}"
432
 }
432
 }
433
 
433
 
434
 function get_app_onion_address {
434
 function get_app_onion_address {

+ 2
- 2
src/freedombone-utils-passwords View File

41
 
41
 
42
 function enforce_good_passwords {
42
 function enforce_good_passwords {
43
     # because humans are generally bad at choosing passwords
43
     # because humans are generally bad at choosing passwords
44
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
44
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
45
         return
45
         return
46
     fi
46
     fi
47
     apt-get -yq install libpam-cracklib
47
     apt-get -yq install libpam-cracklib
48
 
48
 
49
     sed -i 's/password.*requisite.*pam_cracklib.so.*/password        required                       pam_cracklib.so retry=2 dcredit=-4 ucredit=-1 ocredit=-1 lcredit=0 minlen=10 reject_username/g' /etc/pam.d/common-password
49
     sed -i 's/password.*requisite.*pam_cracklib.so.*/password        required                       pam_cracklib.so retry=2 dcredit=-4 ucredit=-1 ocredit=-1 lcredit=0 minlen=10 reject_username/g' /etc/pam.d/common-password
50
-    mark_completed $FUNCNAME
50
+    mark_completed "${FUNCNAME[0]}"
51
 }
51
 }
52
 
52
 
53
 function create_password {
53
 function create_password {

+ 2
- 2
src/freedombone-utils-postgresql View File

69
         return
69
         return
70
     fi
70
     fi
71
 
71
 
72
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
72
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
73
         return
73
         return
74
     fi
74
     fi
75
 
75
 
101
         exit 835290
101
         exit 835290
102
     fi
102
     fi
103
 
103
 
104
-    mark_completed $FUNCNAME
104
+    mark_completed "${FUNCNAME[0]}"
105
 }
105
 }
106
 
106
 
107
 function add_postgresql_user {
107
 function add_postgresql_user {

+ 4
- 4
src/freedombone-utils-repos View File

32
 DEBIAN_REPO="ftp.us.debian.org"
32
 DEBIAN_REPO="ftp.us.debian.org"
33
 
33
 
34
 function create_repo_sources {
34
 function create_repo_sources {
35
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
35
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
36
         return
36
         return
37
     fi
37
     fi
38
     rm -rf /var/lib/apt/lists/*
38
     rm -rf /var/lib/apt/lists/*
53
     apt-get update
53
     apt-get update
54
     apt-get -yq install apt-transport-https
54
     apt-get -yq install apt-transport-https
55
 
55
 
56
-    mark_completed $FUNCNAME
56
+    mark_completed "${FUNCNAME[0]}"
57
 }
57
 }
58
 
58
 
59
 # A command to create a git repository for a project
59
 # A command to create a git repository for a project
60
 function create_git_project {
60
 function create_git_project {
61
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
61
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
62
         return
62
         return
63
     fi
63
     fi
64
     apt-get -yq install git
64
     apt-get -yq install git
86
     echo 'exit 0' >> /usr/bin/$CREATE_GIT_PROJECT_COMMAND
86
     echo 'exit 0' >> /usr/bin/$CREATE_GIT_PROJECT_COMMAND
87
     chmod +x /usr/bin/$CREATE_GIT_PROJECT_COMMAND
87
     chmod +x /usr/bin/$CREATE_GIT_PROJECT_COMMAND
88
 
88
 
89
-    mark_completed $FUNCNAME
89
+    mark_completed "${FUNCNAME[0]}"
90
 }
90
 }
91
 
91
 
92
 # NOTE: deliberately no exit 0
92
 # NOTE: deliberately no exit 0

+ 4
- 4
src/freedombone-utils-rng View File

59
 }
59
 }
60
 
60
 
61
 function check_onerng_verification {
61
 function check_onerng_verification {
62
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
62
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
63
         return
63
         return
64
     fi
64
     fi
65
     if [[ $HWRNG_TYPE != "onerng" ]]; then
65
     if [[ $HWRNG_TYPE != "onerng" ]]; then
78
     echo $'OneRNG firmware verification passed'
78
     echo $'OneRNG firmware verification passed'
79
     # if haveged was previously installed then remove it
79
     # if haveged was previously installed then remove it
80
     apt-get -yq remove haveged
80
     apt-get -yq remove haveged
81
-    mark_completed $FUNCNAME
81
+    mark_completed "${FUNCNAME[0]}"
82
 }
82
 }
83
 
83
 
84
 function install_onerng {
84
 function install_onerng {
131
 }
131
 }
132
 
132
 
133
 function random_number_generator {
133
 function random_number_generator {
134
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
134
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
135
         return
135
         return
136
     fi
136
     fi
137
     if [[ $INSTALLED_WITHIN_DOCKER == "yes" ]]; then
137
     if [[ $INSTALLED_WITHIN_DOCKER == "yes" ]]; then
165
             ;;
165
             ;;
166
     esac
166
     esac
167
 
167
 
168
-    mark_completed $FUNCNAME
168
+    mark_completed "${FUNCNAME[0]}"
169
 }
169
 }
170
 
170
 
171
 # NOTE: deliberately no exit 0
171
 # NOTE: deliberately no exit 0

+ 6
- 6
src/freedombone-utils-setup View File

252
 }
252
 }
253
 
253
 
254
 function initial_setup {
254
 function initial_setup {
255
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
255
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
256
         return
256
         return
257
     fi
257
     fi
258
 
258
 
283
         mkdir -p $INSTALL_DIR
283
         mkdir -p $INSTALL_DIR
284
     fi
284
     fi
285
 
285
 
286
-    mark_completed $FUNCNAME
286
+    mark_completed "${FUNCNAME[0]}"
287
 }
287
 }
288
 
288
 
289
 function turn_off_magic_sysrq {
289
 function turn_off_magic_sysrq {
316
 function search_for_attached_usb_drive {
316
 function search_for_attached_usb_drive {
317
     # If a USB drive is attached then search for email,
317
     # If a USB drive is attached then search for email,
318
     # gpg, ssh keys and emacs configuration
318
     # gpg, ssh keys and emacs configuration
319
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
319
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
320
         return
320
         return
321
     fi
321
     fi
322
     detect_usb_drive
322
     detect_usb_drive
404
         fi
404
         fi
405
         echo $'No USB drive attached'
405
         echo $'No USB drive attached'
406
     fi
406
     fi
407
-    mark_completed $FUNCNAME
407
+    mark_completed "${FUNCNAME[0]}"
408
 }
408
 }
409
 
409
 
410
 function mark_admin_user_account {
410
 function mark_admin_user_account {
681
     if [[ $SYSTEM_TYPE == "mesh"* ]]; then
681
     if [[ $SYSTEM_TYPE == "mesh"* ]]; then
682
         return
682
         return
683
     fi
683
     fi
684
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
684
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
685
         return
685
         return
686
     fi
686
     fi
687
 
687
 
688
     echo "ACTION==\"add\", KERNEL==\"sd*[!0-9]\", RUN+=\"/usr/local/bin/${PROJECT_NAME}-usb-canary\"" > /etc/udev/rules.d/00-usb-canary.rules
688
     echo "ACTION==\"add\", KERNEL==\"sd*[!0-9]\", RUN+=\"/usr/local/bin/${PROJECT_NAME}-usb-canary\"" > /etc/udev/rules.d/00-usb-canary.rules
689
     udevadm control --reload-rules
689
     udevadm control --reload-rules
690
 
690
 
691
-    mark_completed $FUNCNAME
691
+    mark_completed "${FUNCNAME[0]}"
692
 }
692
 }
693
 
693
 
694
 function setup_firewall {
694
 function setup_firewall {

+ 8
- 8
src/freedombone-utils-ssh View File

37
 SSH_HOST_KEY_ALGORITHMS="ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-ed25519,ssh-rsa"
37
 SSH_HOST_KEY_ALGORITHMS="ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-ed25519,ssh-rsa"
38
 
38
 
39
 function configure_ssh {
39
 function configure_ssh {
40
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
40
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
41
         return
41
         return
42
     fi
42
     fi
43
 
43
 
125
 
125
 
126
     function_check configure_firewall_for_ssh
126
     function_check configure_firewall_for_ssh
127
     configure_firewall_for_ssh
127
     configure_firewall_for_ssh
128
-    mark_completed $FUNCNAME
128
+    mark_completed "${FUNCNAME[0]}"
129
 }
129
 }
130
 
130
 
131
 # see https://stribika.github.io/2015/01/04/secure-secure-shell.html
131
 # see https://stribika.github.io/2015/01/04/secure-secure-shell.html
135
 }
135
 }
136
 
136
 
137
 function configure_ssh_client {
137
 function configure_ssh_client {
138
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
138
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
139
         return
139
         return
140
     fi
140
     fi
141
     #sed -i 's/#   PasswordAuthentication.*/   PasswordAuthentication no/g' /etc/ssh/ssh_config
141
     #sed -i 's/#   PasswordAuthentication.*/   PasswordAuthentication no/g' /etc/ssh/ssh_config
165
 
165
 
166
     function_check ssh_remove_small_moduli
166
     function_check ssh_remove_small_moduli
167
     ssh_remove_small_moduli
167
     ssh_remove_small_moduli
168
-    mark_completed $FUNCNAME
168
+    mark_completed "${FUNCNAME[0]}"
169
 }
169
 }
170
 
170
 
171
 function regenerate_ssh_keys {
171
 function regenerate_ssh_keys {
172
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
172
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
173
         return
173
         return
174
     fi
174
     fi
175
     rm -f /etc/ssh/ssh_host_*
175
     rm -f /etc/ssh/ssh_host_*
179
     ssh_remove_small_moduli
179
     ssh_remove_small_moduli
180
 
180
 
181
     systemctl restart ssh
181
     systemctl restart ssh
182
-    mark_completed $FUNCNAME
182
+    mark_completed "${FUNCNAME[0]}"
183
 }
183
 }
184
 
184
 
185
 function configure_firewall_for_ssh {
185
 function configure_firewall_for_ssh {
186
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
186
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
187
         return
187
         return
188
     fi
188
     fi
189
     if [[ $INSTALLED_WITHIN_DOCKER == "yes" ]]; then
189
     if [[ $INSTALLED_WITHIN_DOCKER == "yes" ]]; then
192
     fi
192
     fi
193
 
193
 
194
     firewall_add SSH ${SSH_PORT} tcp
194
     firewall_add SSH ${SSH_PORT} tcp
195
-    mark_completed $FUNCNAME
195
+    mark_completed "${FUNCNAME[0]}"
196
 }
196
 }
197
 
197
 
198
 function get_ssh_server_key {
198
 function get_ssh_server_key {

+ 2
- 2
src/freedombone-utils-tracker View File

65
         return
65
         return
66
     fi
66
     fi
67
 
67
 
68
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
68
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
69
         return
69
         return
70
     fi
70
     fi
71
 
71
 
97
     systemctl enable tracker.service
97
     systemctl enable tracker.service
98
     systemctl start tracker.service
98
     systemctl start tracker.service
99
 
99
 
100
-    mark_completed $FUNCNAME
100
+    mark_completed "${FUNCNAME[0]}"
101
 }
101
 }
102
 
102
 
103
 # NOTE: deliberately no exit 0
103
 # NOTE: deliberately no exit 0

+ 4
- 4
src/freedombone-utils-upgrade View File

43
         fi
43
         fi
44
     fi
44
     fi
45
 
45
 
46
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
46
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
47
         return
47
         return
48
     fi
48
     fi
49
 
49
 
50
     apt-get -yq install unattended-upgrades
50
     apt-get -yq install unattended-upgrades
51
 
51
 
52
-    mark_completed $FUNCNAME
52
+    mark_completed "${FUNCNAME[0]}"
53
 }
53
 }
54
 
54
 
55
 function upgrade_installation_from_previous_versions {
55
 function upgrade_installation_from_previous_versions {
56
     if [ ! -f $COMPLETION_FILE ]; then
56
     if [ ! -f $COMPLETION_FILE ]; then
57
         return
57
         return
58
     fi
58
     fi
59
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
59
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
60
         return
60
         return
61
     fi
61
     fi
62
 
62
 
87
         rm /usr/local/bin/zeronetavahi
87
         rm /usr/local/bin/zeronetavahi
88
     fi
88
     fi
89
 
89
 
90
-    mark_completed $FUNCNAME
90
+    mark_completed "${FUNCNAME[0]}"
91
 }
91
 }
92
 
92
 
93
 # NOTE: deliberately no exit 0
93
 # NOTE: deliberately no exit 0

+ 2
- 2
src/freedombone-utils-watchdog View File

34
 WATCHDOG_SCRIPT_NAME="keepon"
34
 WATCHDOG_SCRIPT_NAME="keepon"
35
 
35
 
36
 function install_watchdog_script {
36
 function install_watchdog_script {
37
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
37
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
38
         return
38
         return
39
     fi
39
     fi
40
     echo '#!/bin/bash' > /usr/bin/$WATCHDOG_SCRIPT_NAME
40
     echo '#!/bin/bash' > /usr/bin/$WATCHDOG_SCRIPT_NAME
46
     function_check cron_add_mins
46
     function_check cron_add_mins
47
     cron_add_mins 1 "/usr/bin/$WATCHDOG_SCRIPT_NAME"
47
     cron_add_mins 1 "/usr/bin/$WATCHDOG_SCRIPT_NAME"
48
 
48
 
49
-    mark_completed $FUNCNAME
49
+    mark_completed "${FUNCNAME[0]}"
50
 }
50
 }
51
 
51
 
52
 function daemon_is_running {
52
 function daemon_is_running {

+ 8
- 8
src/freedombone-utils-web View File

437
     function_check set_repo_commit
437
     function_check set_repo_commit
438
     set_repo_commit $INSTALL_DIR/inadyn "inadyn commit" "$INADYN_COMMIT" $INADYN_REPO
438
     set_repo_commit $INSTALL_DIR/inadyn "inadyn commit" "$INADYN_COMMIT" $INADYN_REPO
439
 
439
 
440
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
440
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
441
         return
441
         return
442
     fi
442
     fi
443
 
443
 
512
     systemctl start inadyn
512
     systemctl start inadyn
513
     systemctl daemon-reload
513
     systemctl daemon-reload
514
 
514
 
515
-    mark_completed $FUNCNAME
515
+    mark_completed "${FUNCNAME[0]}"
516
 }
516
 }
517
 
517
 
518
 function update_default_search_engine {
518
 function update_default_search_engine {
539
 }
539
 }
540
 
540
 
541
 function install_command_line_browser {
541
 function install_command_line_browser {
542
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
542
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
543
         return
543
         return
544
     fi
544
     fi
545
     apt-get -yq install elinks
545
     apt-get -yq install elinks
546
     update_default_search_engine
546
     update_default_search_engine
547
 
547
 
548
-    mark_completed $FUNCNAME
548
+    mark_completed "${FUNCNAME[0]}"
549
 }
549
 }
550
 
550
 
551
 function mesh_web_server {
551
 function mesh_web_server {
572
     function_check set_repo_commit
572
     function_check set_repo_commit
573
     set_repo_commit $INSTALL_DIR/nginx_ensite "nginx-ensite commit" "$NGINX_ENSITE_COMMIT" $NGINX_ENSITE_REPO
573
     set_repo_commit $INSTALL_DIR/nginx_ensite "nginx-ensite commit" "$NGINX_ENSITE_COMMIT" $NGINX_ENSITE_REPO
574
 
574
 
575
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
575
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
576
         return
576
         return
577
     fi
577
     fi
578
     # remove apache
578
     # remove apache
714
     function_check configure_firewall_for_web_access
714
     function_check configure_firewall_for_web_access
715
     configure_firewall_for_web_access
715
     configure_firewall_for_web_access
716
 
716
 
717
-    mark_completed $FUNCNAME
717
+    mark_completed "${FUNCNAME[0]}"
718
 }
718
 }
719
 
719
 
720
 function remove_certs {
720
 function remove_certs {
742
 }
742
 }
743
 
743
 
744
 function configure_firewall_for_web_access {
744
 function configure_firewall_for_web_access {
745
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
745
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
746
         return
746
         return
747
     fi
747
     fi
748
     if [[ $INSTALLED_WITHIN_DOCKER == "yes" ]]; then
748
     if [[ $INSTALLED_WITHIN_DOCKER == "yes" ]]; then
754
     fi
754
     fi
755
     firewall_add HTTP 80 tcp
755
     firewall_add HTTP 80 tcp
756
     firewall_add HTTPS 443 tcp
756
     firewall_add HTTPS 443 tcp
757
-    mark_completed $FUNCNAME
757
+    mark_completed "${FUNCNAME[0]}"
758
 }
758
 }
759
 
759
 
760
 function update_default_domain {
760
 function update_default_domain {

+ 5
- 5
src/freedombone-utils-wifi View File

120
         return
120
         return
121
     fi
121
     fi
122
 
122
 
123
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
123
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
124
         return
124
         return
125
     fi
125
     fi
126
 
126
 
131
 
131
 
132
     if [ -f $WIFI_NETWORKS_FILE ]; then
132
     if [ -f $WIFI_NETWORKS_FILE ]; then
133
         ${PROJECT_NAME}-wifi --networks $WIFI_NETWORKS_FILE
133
         ${PROJECT_NAME}-wifi --networks $WIFI_NETWORKS_FILE
134
-        mark_completed $FUNCNAME
134
+        mark_complete "${FUNCNAME[0]}"
135
         return
135
         return
136
     fi
136
     fi
137
 
137
 
148
     else
148
     else
149
         ${PROJECT_NAME}-wifi -s $WIFI_SSID -t $WIFI_TYPE --hotspot $HOTSPOT --networks $WIFI_NETWORKS_FILE
149
         ${PROJECT_NAME}-wifi -s $WIFI_SSID -t $WIFI_TYPE --hotspot $HOTSPOT --networks $WIFI_NETWORKS_FILE
150
     fi
150
     fi
151
-    mark_completed $FUNCNAME
151
+    mark_completed "${FUNCNAME[0]}"
152
 }
152
 }
153
 
153
 
154
 # ath9k_htc driver
154
 # ath9k_htc driver
155
 function install_atheros_wifi {
155
 function install_atheros_wifi {
156
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
156
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
157
         return
157
         return
158
     fi
158
     fi
159
     if [ $INSTALLING_ON_BBB != "yes" ]; then
159
     if [ $INSTALLING_ON_BBB != "yes" ]; then
198
     if [ ! "$?" = "0" ]; then
198
     if [ ! "$?" = "0" ]; then
199
         exit 74681
199
         exit 74681
200
     fi
200
     fi
201
-    mark_completed $FUNCNAME
201
+    mark_completed "${FUNCNAME[0]}"
202
 }
202
 }
203
 
203
 
204
 function update_wifi_adaptors {
204
 function update_wifi_adaptors {

+ 2
- 2
src/freedombone-utils-zram View File

29
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
29
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
30
 
30
 
31
 function enable_zram {
31
 function enable_zram {
32
-    if [[ $(is_completed $FUNCNAME) == "1" ]]; then
32
+    if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
33
         return
33
         return
34
     fi
34
     fi
35
 
35
 
40
 
40
 
41
     ${PROJECT_NAME}-zram on
41
     ${PROJECT_NAME}-zram on
42
 
42
 
43
-    mark_completed $FUNCNAME
43
+    mark_completed "${FUNCNAME[0]}"
44
 }
44
 }
45
 
45
 
46
 # NOTE: deliberately no exit 0
46
 # NOTE: deliberately no exit 0

+ 1
- 1
src/freedombone-zram View File

48
       echo "ExecStart=${PROJECT_NAME}-zram on";
48
       echo "ExecStart=${PROJECT_NAME}-zram on";
49
       echo '';
49
       echo '';
50
       echo '[Install]';
50
       echo '[Install]';
51
-      echo 'WantedBy=multi-user.target'; } >> $DAEMON_FILENAME
51
+      echo 'WantedBy=multi-user.target'; } > $DAEMON_FILENAME
52
 }
52
 }
53
 
53
 
54
 function zram_on {
54
 function zram_on {