Selaa lähdekoodia

Preparing for international strings

Bob Mottram 9 vuotta sitten
vanhempi
commit
ef9fcb946d

+ 38
- 38
src/freedombone Näytä tiedosto

461
 
461
 
462
 function show_help {
462
 function show_help {
463
   echo ''
463
   echo ''
464
-  echo 'freedombone -c [configuration file]'
464
+  echo $'freedombone -c [configuration file]'
465
   echo ''
465
   echo ''
466
-  echo '  -h --help             Show help'
467
-  echo '     menuconfig         Easy interactive installation'
468
-  echo '  -c --config           Installing from a configuration file'
469
-  echo '     --bbb              Installing on Beaglebone Black'
470
-  echo '  -u --user             User to install the system as'
471
-  echo '  -d --domain           Default domain name'
472
-  echo '  -s --system           System type'
473
-  echo '     --ip               Static LAN IP address of the system'
474
-  echo '     --iprouter         LAN IP address of the internet router'
475
-  echo '     --ddns             Dynamic DNS provider domain'
476
-  echo '     --ddnsuser         Dynamic DNS provider username'
477
-  echo '     --ddnspass         Dynamic DNS provider password'
466
+  echo $'  -h --help             Show help'
467
+  echo $'     menuconfig         Easy interactive installation'
468
+  echo $'  -c --config           Installing from a configuration file'
469
+  echo $'     --bbb              Installing on Beaglebone Black'
470
+  echo $'  -u --user             User to install the system as'
471
+  echo $'  -d --domain           Default domain name'
472
+  echo $'  -s --system           System type'
473
+  echo $'     --ip               Static LAN IP address of the system'
474
+  echo $'     --iprouter         LAN IP address of the internet router'
475
+  echo $'     --ddns             Dynamic DNS provider domain'
476
+  echo $'     --ddnsuser         Dynamic DNS provider username'
477
+  echo $'     --ddnspass         Dynamic DNS provider password'
478
   echo ''
478
   echo ''
479
-  echo '     --microblogdomain  Microblog domain name'
480
-  echo '     --wikidomain       Wiki domain name'
481
-  echo '     --blogdomain       Blog domain name'
482
-  echo '     --ownclouddomain   Owncloud domain name'
483
-  echo '     --hubzilladomain   Hubzilla domain name'
484
-  echo '     --gitdomain        Git hosting domain name'
485
-  echo '  -t --time             Domain used as a TLS time source'
486
-  echo '     --ssh              ssh port number'
487
-  echo '     --list             Public mailing list name'
488
-  echo '     --cores            Number of CPU cores'
489
-  echo '     --name             Your name'
490
-  echo '     --email            Your email address'
491
-  echo '     --usb              Path for the USB drive (eg. /dev/sdb1)'
492
-  echo '     --cjdns            Enable CJDNS'
493
-  echo '     --vpass            VoIP server password'
494
-  echo '     --vport            VoIP server port'
495
-  echo '     --ns1              First DNS nameserver'
496
-  echo '     --ns2              Second DNS nameserver'
497
-  echo '     --repo             Debian repository'
479
+  echo $'     --microblogdomain  Microblog domain name'
480
+  echo $'     --wikidomain       Wiki domain name'
481
+  echo $'     --blogdomain       Blog domain name'
482
+  echo $'     --ownclouddomain   Owncloud domain name'
483
+  echo $'     --hubzilladomain   Hubzilla domain name'
484
+  echo $'     --gitdomain        Git hosting domain name'
485
+  echo $'  -t --time             Domain used as a TLS time source'
486
+  echo $'     --ssh              ssh port number'
487
+  echo $'     --list             Public mailing list name'
488
+  echo $'     --cores            Number of CPU cores'
489
+  echo $'     --name             Your name'
490
+  echo $'     --email            Your email address'
491
+  echo $'     --usb              Path for the USB drive (eg. /dev/sdb1)'
492
+  echo $'     --cjdns            Enable CJDNS'
493
+  echo $'     --vpass            VoIP server password'
494
+  echo $'     --vport            VoIP server port'
495
+  echo $'     --ns1              First DNS nameserver'
496
+  echo $'     --ns2              Second DNS nameserver'
497
+  echo $'     --repo             Debian repository'
498
   echo ''
498
   echo ''
499
-  echo 'system types'
499
+  echo $'system types'
500
   echo '------------'
500
   echo '------------'
501
-  echo 'This can either be blank if you wish to install the full system,'
502
-  echo "or for more specialised variants you can specify '$VARIANT_MAILBOX', '$VARIANT_CLOUD',"
503
-  echo "'$VARIANT_CHAT', '$VARIANT_SOCIAL', '$VARIANT_MEDIA', '$VARIANT_WRITER', '$VARIANT_DEVELOPER'"
504
-  echo "or '$VARIANT_MESH'."
501
+  echo $'This can either be blank if you wish to install the full system,'
502
+  echo $"or for more specialised variants you can specify '$VARIANT_MAILBOX', '$VARIANT_CLOUD',"
503
+  echo $"'$VARIANT_CHAT', '$VARIANT_SOCIAL', '$VARIANT_MEDIA', '$VARIANT_WRITER', '$VARIANT_DEVELOPER'"
504
+  echo $"or '$VARIANT_MESH'."
505
   echo ''
505
   echo ''
506
-  echo "If you wish to install everything except email then use the '$VARIANT_NONMAILBOX' variaint."
506
+  echo $"If you wish to install everything except email then use the '$VARIANT_NONMAILBOX' variaint."
507
   echo ''
507
   echo ''
508
   exit 0
508
   exit 0
509
 }
509
 }

+ 18
- 18
src/freedombone-addcert Näytä tiedosto

48
 
48
 
49
 function show_help {
49
 function show_help {
50
     echo ''
50
     echo ''
51
-    echo 'freedombone-addcert -h [hostname] -c [country code] -a [area] -l [location]'
52
-    echo '                    -o [organisation] -u [unit] --ca "" --nodh ""'
51
+    echo $'freedombone-addcert -h [hostname] -c [country code] -a [area] -l [location]'
52
+    echo $'                    -o [organisation] -u [unit] --ca "" --nodh ""'
53
     echo ''
53
     echo ''
54
-    echo 'Creates a self-signed certificate for the given hostname'
54
+    echo $'Creates a self-signed certificate for the given hostname'
55
     echo ''
55
     echo ''
56
-    echo '     --help                   Show help'
57
-    echo '  -h --hostname [name]        Hostname'
58
-    echo '  -e --letsencrypt [hostname] Hostname to use with Lets Encrypt'
59
-    echo '  -s --server [url]           Lets Encrypt server URL'
60
-    echo '  -c --country [code]         Optional country code (eg. US, GB, etc)'
61
-    echo '  -a --area [description]     Optional area description'
62
-    echo '  -l --location [locn]        Optional location name'
63
-    echo '  -o --organisation [name]    Optional organisation name'
64
-    echo '  -u --unit [name]            Optional unit name'
65
-    echo '     --dhkey [bits]           DH key length in bits'
66
-    echo '     --nodh ""                Do not calculate DH params'
67
-    echo '     --ca ""                  Certificate authority cert'
56
+    echo $'     --help                   Show help'
57
+    echo $'  -h --hostname [name]        Hostname'
58
+    echo $'  -e --letsencrypt [hostname] Hostname to use with Lets Encrypt'
59
+    echo $'  -s --server [url]           Lets Encrypt server URL'
60
+    echo $'  -c --country [code]         Optional country code (eg. US, GB, etc)'
61
+    echo $'  -a --area [description]     Optional area description'
62
+    echo $'  -l --location [locn]        Optional location name'
63
+    echo $'  -o --organisation [name]    Optional organisation name'
64
+    echo $'  -u --unit [name]            Optional unit name'
65
+    echo $'     --dhkey [bits]           DH key length in bits'
66
+    echo $'     --nodh ""                Do not calculate DH params'
67
+    echo $'     --ca ""                  Certificate authority cert'
68
     echo ''
68
     echo ''
69
     exit 0
69
     exit 0
70
 }
70
 }
131
 
131
 
132
 if [ ! $HOSTNAME ]; then
132
 if [ ! $HOSTNAME ]; then
133
 	if [ ! $LETSENCRYPT_HOSTNAME ]; then
133
 	if [ ! $LETSENCRYPT_HOSTNAME ]; then
134
-        echo 'No hostname specified'
134
+        echo $'No hostname specified'
135
         exit 5748
135
         exit 5748
136
 	fi
136
 	fi
137
 fi
137
 fi
138
 
138
 
139
 if ! which openssl > /dev/null ;then
139
 if ! which openssl > /dev/null ;then
140
-    echo "$0: openssl is not installed, exiting" 1>&2
140
+    echo $"$0: openssl is not installed, exiting" 1>&2
141
     exit 5689
141
     exit 5689
142
 fi
142
 fi
143
 
143
 
169
 	# TODO this requires user interaction - is there a non-interactive mode?
169
 	# TODO this requires user interaction - is there a non-interactive mode?
170
 	./letsencrypt-auto certonly --server $LETSENCRYPT_SERVER --standalone -d $LETSENCRYPT_HOSTNAME
170
 	./letsencrypt-auto certonly --server $LETSENCRYPT_SERVER --standalone -d $LETSENCRYPT_HOSTNAME
171
 	if [ ! "$?" = "0" ]; then
171
 	if [ ! "$?" = "0" ]; then
172
-		echo "Failed to install letsencrypt for domain $LETSENCRYPT_HOSTNAME"
172
+		echo $"Failed to install letsencrypt for domain $LETSENCRYPT_HOSTNAME"
173
 		exit 63216
173
 		exit 63216
174
 	fi
174
 	fi
175
 
175
 

+ 1
- 1
src/freedombone-addemail Näytä tiedosto

40
 
40
 
41
 function show_help {
41
 function show_help {
42
     echo ''
42
     echo ''
43
-    echo 'freedombone-addemail -u [username] -e [email address] -g [group name]'
43
+    echo $'freedombone-addemail -u [username] -e [email address] -g [group name]'
44
     echo ''
44
     echo ''
45
     exit 0
45
     exit 0
46
 }
46
 }

+ 5
- 5
src/freedombone-addsipuser Näytä tiedosto

42
 
42
 
43
 function show_help {
43
 function show_help {
44
     echo ''
44
     echo ''
45
-    echo 'freedombone-addsipuser -u [username] -e [extension] -p [password]'
45
+    echo $'freedombone-addsipuser -u [username] -e [extension] -p [password]'
46
     echo ''
46
     echo ''
47
     exit 0
47
     exit 0
48
 }
48
 }
140
 fi
140
 fi
141
 
141
 
142
 if [ ! -f $CONFIG_FILE ]; then
142
 if [ ! -f $CONFIG_FILE ]; then
143
-    echo "SIP configuration file not found"
143
+    echo $"SIP configuration file not found"
144
     exit 1
144
     exit 1
145
 fi
145
 fi
146
 
146
 
147
 # the user must already exist on the system
147
 # the user must already exist on the system
148
 if [ ! -d /home/$MY_USERNAME ]; then
148
 if [ ! -d /home/$MY_USERNAME ]; then
149
-    echo "User $MY_USERNAME not found"
149
+    echo $"User $MY_USERNAME not found"
150
     exit 2
150
     exit 2
151
 fi
151
 fi
152
 
152
 
154
 
154
 
155
 if [[ $USER_EXISTS == "yes" ]]; then
155
 if [[ $USER_EXISTS == "yes" ]]; then
156
     update_sip_user
156
     update_sip_user
157
-    echo "SIP user $MY_USERNAME amended"
157
+    echo $"SIP user $MY_USERNAME amended"
158
 else
158
 else
159
     add_sip_user
159
     add_sip_user
160
-    echo "SIP user $MY_USERNAME added"
160
+    echo $"SIP user $MY_USERNAME added"
161
 fi
161
 fi
162
 
162
 
163
 systemctl restart sipwitch
163
 systemctl restart sipwitch

+ 30
- 30
src/freedombone-adduser Näytä tiedosto

43
 FULLBLOG_DOMAIN_NAME=
43
 FULLBLOG_DOMAIN_NAME=
44
 
44
 
45
 if [ ! $MY_USERNAME ]; then
45
 if [ ! $MY_USERNAME ]; then
46
-    echo 'No username was given'
46
+    echo $'No username was given'
47
     exit 1
47
     exit 1
48
 fi
48
 fi
49
 
49
 
50
 if [ -d /home/$MY_USERNAME ]; then
50
 if [ -d /home/$MY_USERNAME ]; then
51
-    echo "The user $MY_USERNAME already exists"
51
+    echo $"The user $MY_USERNAME already exists"
52
     exit 2
52
     exit 2
53
 fi
53
 fi
54
 
54
 
55
 if [ ! -f $COMPLETION_FILE ]; then
55
 if [ ! -f $COMPLETION_FILE ]; then
56
-    echo "$COMPLETION_FILE not found"
56
+    echo $"$COMPLETION_FILE not found"
57
     userdel -r $MY_USERNAME
57
     userdel -r $MY_USERNAME
58
     exit 3
58
     exit 3
59
 fi
59
 fi
63
 adduser $MY_USERNAME sasl
63
 adduser $MY_USERNAME sasl
64
 
64
 
65
 if [ ! -d /home/$MY_USERNAME ]; then
65
 if [ ! -d /home/$MY_USERNAME ]; then
66
-    echo 'Home directory was not created'
66
+    echo $'Home directory was not created'
67
     exit 4
67
     exit 4
68
 fi
68
 fi
69
 
69
 
73
             mkdir /home/$MY_USERNAME/.ssh
73
             mkdir /home/$MY_USERNAME/.ssh
74
             cp $SSH_PUBLIC_KEY /home/$MY_USERNAME/.ssh/authorized_keys
74
             cp $SSH_PUBLIC_KEY /home/$MY_USERNAME/.ssh/authorized_keys
75
             chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.ssh
75
             chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.ssh
76
-            echo 'ssh public key installed'
76
+            echo $'ssh public key installed'
77
         else
77
         else
78
             if [[ "$SSH_PUBLIC_KEY" == "ssh-"* ]]; then
78
             if [[ "$SSH_PUBLIC_KEY" == "ssh-"* ]]; then
79
                 mkdir /home/$MY_USERNAME/.ssh
79
                 mkdir /home/$MY_USERNAME/.ssh
80
                 echo "$SSH_PUBLIC_KEY" > /home/$MY_USERNAME/.ssh/authorized_keys
80
                 echo "$SSH_PUBLIC_KEY" > /home/$MY_USERNAME/.ssh/authorized_keys
81
                 chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.ssh
81
                 chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.ssh
82
-                echo 'ssh public key installed'
82
+                echo $'ssh public key installed'
83
             else
83
             else
84
-                echo 'The second parameter does not look like an ssh key'
84
+                echo $'The second parameter does not look like an ssh key'
85
                 exit 5
85
                 exit 5
86
             fi
86
             fi
87
         fi
87
         fi
89
 fi
89
 fi
90
 
90
 
91
 if [ ! -d /home/$MY_USERNAME/Maildir ]; then
91
 if [ ! -d /home/$MY_USERNAME/Maildir ]; then
92
-    echo 'Email directory was not created'
92
+    echo $'Email directory was not created'
93
     userdel -r $MY_USERNAME
93
     userdel -r $MY_USERNAME
94
     exit 6
94
     exit 6
95
 fi
95
 fi
142
 # encrypt outgoing mail to the "sent" folder
142
 # encrypt outgoing mail to the "sent" folder
143
 if ! grep -q "pgp_encrypt_only_command" /home/$MY_USERNAME/.muttrc; then
143
 if ! grep -q "pgp_encrypt_only_command" /home/$MY_USERNAME/.muttrc; then
144
     echo '' >> /home/$MY_USERNAME/.muttrc
144
     echo '' >> /home/$MY_USERNAME/.muttrc
145
-    echo '# Encrypt items in the Sent folder' >> /home/$MY_USERNAME/.muttrc
145
+    echo $'# Encrypt items in the Sent folder' >> /home/$MY_USERNAME/.muttrc
146
     echo "set pgp_encrypt_only_command=\"/usr/lib/mutt/pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to 0x$MY_GPG_PUBLIC_KEY_ID -- -r %r -- %f\"" >> /home/$MY_USERNAME/.muttrc
146
     echo "set pgp_encrypt_only_command=\"/usr/lib/mutt/pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to 0x$MY_GPG_PUBLIC_KEY_ID -- -r %r -- %f\"" >> /home/$MY_USERNAME/.muttrc
147
 else
147
 else
148
     sed -i "s|set pgp_encrypt_only_command.*|set pgp_encrypt_only_command=\"/usr/lib/mutt/pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to 0x$MY_GPG_PUBLIC_KEY_ID -- -r %r -- %f\"|g" /home/$MY_USERNAME/.muttrc
148
     sed -i "s|set pgp_encrypt_only_command.*|set pgp_encrypt_only_command=\"/usr/lib/mutt/pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to 0x$MY_GPG_PUBLIC_KEY_ID -- -r %r -- %f\"|g" /home/$MY_USERNAME/.muttrc
157
 if ! grep -q "Change your GPG password" /home/$MY_USERNAME/README; then
157
 if ! grep -q "Change your GPG password" /home/$MY_USERNAME/README; then
158
     echo '' >> /home/$MY_USERNAME/README
158
     echo '' >> /home/$MY_USERNAME/README
159
     echo '' >> /home/$MY_USERNAME/README
159
     echo '' >> /home/$MY_USERNAME/README
160
-    echo 'Change your GPG password' >> /home/$MY_USERNAME/README
160
+    echo $'Change your GPG password' >> /home/$MY_USERNAME/README
161
     echo '========================' >> /home/$MY_USERNAME/README
161
     echo '========================' >> /home/$MY_USERNAME/README
162
-    echo "It's very important to add a password to your GPG key so that" >> /home/$MY_USERNAME/README
163
-    echo "if anyone does get access to your email they still won't be able" >> /home/$MY_USERNAME/README
164
-    echo 'to read them without knowning the GPG password.' >> /home/$MY_USERNAME/README
165
-    echo 'You can change the it with:' >> /home/$MY_USERNAME/README
162
+    echo $"It's very important to add a password to your GPG key so that" >> /home/$MY_USERNAME/README
163
+    echo $"if anyone does get access to your email they still won't be able" >> /home/$MY_USERNAME/README
164
+    echo $'to read them without knowning the GPG password.' >> /home/$MY_USERNAME/README
165
+    echo $'You can change the it with:' >> /home/$MY_USERNAME/README
166
     echo '' >> /home/$MY_USERNAME/README
166
     echo '' >> /home/$MY_USERNAME/README
167
     echo "  gpg --edit-key $MY_GPG_PUBLIC_KEY_ID" >> /home/$MY_USERNAME/README
167
     echo "  gpg --edit-key $MY_GPG_PUBLIC_KEY_ID" >> /home/$MY_USERNAME/README
168
     echo '  passwd' >> /home/$MY_USERNAME/README
168
     echo '  passwd' >> /home/$MY_USERNAME/README
173
 if ! grep -q "Publish your GPG public key" /home/$MY_USERNAME/README; then
173
 if ! grep -q "Publish your GPG public key" /home/$MY_USERNAME/README; then
174
     echo '' >> /home/$MY_USERNAME/README
174
     echo '' >> /home/$MY_USERNAME/README
175
     echo '' >> /home/$MY_USERNAME/README
175
     echo '' >> /home/$MY_USERNAME/README
176
-    echo 'Publish your GPG public key' >> /home/$MY_USERNAME/README
176
+    echo $'Publish your GPG public key' >> /home/$MY_USERNAME/README
177
     echo '===========================' >> /home/$MY_USERNAME/README
177
     echo '===========================' >> /home/$MY_USERNAME/README
178
-    echo 'So that others can send emails to you securely you should' >> /home/$MY_USERNAME/README
179
-    echo 'publish your GPG public key with the command:' >> /home/$MY_USERNAME/README
178
+    echo $'So that others can send emails to you securely you should' >> /home/$MY_USERNAME/README
179
+    echo $'publish your GPG public key with the command:' >> /home/$MY_USERNAME/README
180
     echo '' >> /home/$MY_USERNAME/README
180
     echo '' >> /home/$MY_USERNAME/README
181
     echo "  gpg --send-keys $MY_GPG_PUBLIC_KEY_ID" >> /home/$MY_USERNAME/README
181
     echo "  gpg --send-keys $MY_GPG_PUBLIC_KEY_ID" >> /home/$MY_USERNAME/README
182
 fi
182
 fi
186
 chmod 600 /home/$MY_USERNAME/README
186
 chmod 600 /home/$MY_USERNAME/README
187
 
187
 
188
 if grep -q "install_xmpp" $COMPLETION_FILE; then
188
 if grep -q "install_xmpp" $COMPLETION_FILE; then
189
-    echo "Adding an XMPP account for $MY_USERNAME"
189
+    echo $"Adding an XMPP account for $MY_USERNAME"
190
     freedombone-addxmpp -e "$MY_USERNAME@$HOSTNAME" -p "$NEW_USER_PASSWORD"
190
     freedombone-addxmpp -e "$MY_USERNAME@$HOSTNAME" -p "$NEW_USER_PASSWORD"
191
     if [ ! "$?" = "0" ]; then
191
     if [ ! "$?" = "0" ]; then
192
-        echo "XMPP account not created"
192
+        echo $"XMPP account not created"
193
         userdel -r $MY_USERNAME
193
         userdel -r $MY_USERNAME
194
         exit 8
194
         exit 8
195
     fi
195
     fi
198
 if grep -q "Blog domain" $COMPLETION_FILE; then
198
 if grep -q "Blog domain" $COMPLETION_FILE; then
199
     FULLBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Blog domain" | awk -F ':' '{print $2}')
199
     FULLBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Blog domain" | awk -F ':' '{print $2}')
200
     if [ ! -d /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/users ]; then
200
     if [ ! -d /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/users ]; then
201
-        echo 'Blog users directory not found'
201
+        echo $'Blog users directory not found'
202
         if grep -q "install_xmpp" $COMPLETION_FILE; then
202
         if grep -q "install_xmpp" $COMPLETION_FILE; then
203
             freedombone-rmxmpp -e "$MY_USERNAME@$HOSTNAME"
203
             freedombone-rmxmpp -e "$MY_USERNAME@$HOSTNAME"
204
         fi
204
         fi
217
     SIP_EXTENSION=$(freedombone-sipfreeext)
217
     SIP_EXTENSION=$(freedombone-sipfreeext)
218
     freedombone-addsipuser -u $MY_USERNAME -e $SIP_EXTENSION -p "$NEW_USER_PASSWORD"
218
     freedombone-addsipuser -u $MY_USERNAME -e $SIP_EXTENSION -p "$NEW_USER_PASSWORD"
219
     if [ ! "$?" = "0" ]; then
219
     if [ ! "$?" = "0" ]; then
220
-        echo 'SIP user could not be added. Ensure that extension numbers are in order and do no exceed 299'
220
+        echo $'SIP user could not be added. Ensure that extension numbers are in order and do no exceed 299'
221
         if grep -q "install_xmpp" $COMPLETION_FILE; then
221
         if grep -q "install_xmpp" $COMPLETION_FILE; then
222
             freedombone-rmxmpp -e "$MY_USERNAME@$HOSTNAME"
222
             freedombone-rmxmpp -e "$MY_USERNAME@$HOSTNAME"
223
         fi
223
         fi
255
 #fi
255
 #fi
256
 
256
 
257
 clear
257
 clear
258
-echo "New user $MY_USERNAME was created"
258
+echo $"New user $MY_USERNAME was created"
259
 if [ $SIP_EXTENSION ]; then
259
 if [ $SIP_EXTENSION ]; then
260
-    echo "Their SIP phone extension is $SIP_EXTENSION"
260
+    echo $"Their SIP phone extension is $SIP_EXTENSION"
261
 fi
261
 fi
262
-echo "Their login password is $NEW_USER_PASSWORD"
262
+echo $"Their login password is $NEW_USER_PASSWORD"
263
 echo ''
263
 echo ''
264
-echo 'IMPORTANT: Make a note of the password, because it will not be saved'
265
-echo 'anywhere else. Preferably give it to them in person on paper or via'
266
-echo 'a secure channel, not in an unencrypted email.'
264
+echo $'IMPORTANT: Make a note of the password, because it will not be saved'
265
+echo $'anywhere else. Preferably give it to them in person on paper or via'
266
+echo $'a secure channel, not in an unencrypted email.'
267
 echo ''
267
 echo ''
268
-echo "They can download their GPG keys with:"
268
+echo $"They can download their GPG keys with:"
269
 echo ''
269
 echo ''
270
 echo "    scp -P $SSH_PORT -r $MY_USERNAME@$HOSTNAME:/home/$MY_USERNAME/.gnupg ~/"
270
 echo "    scp -P $SSH_PORT -r $MY_USERNAME@$HOSTNAME:/home/$MY_USERNAME/.gnupg ~/"
271
 echo ''
271
 echo ''
272
-echo 'They should also run freedombone-client on their system to ensure'
273
-echo 'the best security.'
272
+echo $'They should also run freedombone-client on their system to ensure'
273
+echo $'the best security.'
274
 
274
 
275
 exit 0
275
 exit 0

+ 2
- 2
src/freedombone-addxmpp Näytä tiedosto

39
 
39
 
40
 function show_help {
40
 function show_help {
41
     echo ''
41
     echo ''
42
-    echo 'freedombone-addxmpp -e [email address] -p [password]'
42
+    echo $'freedombone-addxmpp -e [email address] -p [password]'
43
     echo ''
43
     echo ''
44
     exit 0
44
     exit 0
45
 }
45
 }
68
 done
68
 done
69
 
69
 
70
 if [ ! -d /etc/prosody ]; then
70
 if [ ! -d /etc/prosody ]; then
71
-    echo 'xmpp server is not installed'
71
+    echo $'xmpp server is not installed'
72
     exit 0
72
     exit 0
73
 fi
73
 fi
74
 
74
 

+ 4
- 4
src/freedombone-client Näytä tiedosto

103
   ssh_remove_small_moduli
103
   ssh_remove_small_moduli
104
 
104
 
105
   echo ''
105
   echo ''
106
-  echo 'Copy the following into a file called /home/username/.ssh/authorized_keys on the Freedombone server'
106
+  echo $'Copy the following into a file called /home/username/.ssh/authorized_keys on the Freedombone server'
107
   echo ''
107
   echo ''
108
   echo $(cat /home/$CURR_USER/.ssh/id_rsa.pub)
108
   echo $(cat /home/$CURR_USER/.ssh/id_rsa.pub)
109
   echo $(cat /home/$CURR_USER/.ssh/id_ed25519.pub)
109
   echo $(cat /home/$CURR_USER/.ssh/id_ed25519.pub)
477
 
477
 
478
 function show_help {
478
 function show_help {
479
     echo ''
479
     echo ''
480
-    echo 'freedombone-client'
480
+    echo $'freedombone-client'
481
     echo ''
481
     echo ''
482
     exit 0
482
     exit 0
483
 }
483
 }
505
 shift
505
 shift
506
 done
506
 done
507
 
507
 
508
-echo 'Configuring client'
508
+echo $'Configuring client'
509
 configure_ssh_client
509
 configure_ssh_client
510
 mesh_batman
510
 mesh_batman
511
 mesh_babel
511
 mesh_babel
512
-echo 'Configuration complete'
512
+echo $'Configuration complete'
513
 exit 0
513
 exit 0

+ 11
- 11
src/freedombone-clientcert Näytä tiedosto

47
 
47
 
48
 function show_help {
48
 function show_help {
49
     echo ''
49
     echo ''
50
-    echo 'freedombone-clientcert -u [username]'
50
+    echo $'freedombone-clientcert -u [username]'
51
     echo ''
51
     echo ''
52
-    echo 'Creates email certificates for use with IMAP clients'
52
+    echo $'Creates email certificates for use with IMAP clients'
53
     echo ''
53
     echo ''
54
-    echo '     --help                  Show help'
55
-    echo '  -u --username [name]       Username'
54
+    echo $'     --help                  Show help'
55
+    echo $'  -u --username [name]       Username'
56
     echo ''
56
     echo ''
57
     exit 0
57
     exit 0
58
 }
58
 }
77
 done
77
 done
78
 
78
 
79
 if [ ! $USERNAME ]; then
79
 if [ ! $USERNAME ]; then
80
-    echo 'No username specified'
80
+    echo $'No username specified'
81
     exit 5748
81
     exit 5748
82
 fi
82
 fi
83
 
83
 
84
 if [ ! -d /home/$USERNAME ]; then
84
 if [ ! -d /home/$USERNAME ]; then
85
-    echo "User $USERNAME not found"
85
+    echo $"User $USERNAME not found"
86
     exit 76239
86
     exit 76239
87
 fi
87
 fi
88
 
88
 
89
 if [ -d /home/$USERNAME/emailcert ]; then
89
 if [ -d /home/$USERNAME/emailcert ]; then
90
-    echo 'Client certs were already for created'
90
+    echo $'Client certs were already for created'
91
     exit 2953
91
     exit 2953
92
 fi
92
 fi
93
 
93
 
106
 freedombone-addcert -h $USERNAME --nodh ""
106
 freedombone-addcert -h $USERNAME --nodh ""
107
 
107
 
108
 if [ ! -f /etc/ssl/private/$USERNAME.key ]; then
108
 if [ ! -f /etc/ssl/private/$USERNAME.key ]; then
109
-    echo 'User certificates were not created'
109
+    echo $'User certificates were not created'
110
     rm -rf /home/$USERNAME/emailcert
110
     rm -rf /home/$USERNAME/emailcert
111
     exit 74835
111
     exit 74835
112
 fi
112
 fi
118
         -out /etc/ssl/requests/$USERNAME.csr
118
         -out /etc/ssl/requests/$USERNAME.csr
119
 
119
 
120
 if [ ! -f /etc/ssl/requests/$USERNAME.csr ]; then
120
 if [ ! -f /etc/ssl/requests/$USERNAME.csr ]; then
121
-    echo 'Certificate request was not created'
121
+    echo $'Certificate request was not created'
122
     rm -rf /home/$USERNAME/emailcert
122
     rm -rf /home/$USERNAME/emailcert
123
     exit 83520
123
     exit 83520
124
 fi
124
 fi
130
         -out /etc/ssl/certs/$USERNAME.cer
130
         -out /etc/ssl/certs/$USERNAME.cer
131
 
131
 
132
 if [ ! -f /etc/ssl/certs/$USERNAME.cer ]; then
132
 if [ ! -f /etc/ssl/certs/$USERNAME.cer ]; then
133
-    echo 'Authentication certificate was not created'
133
+    echo $'Authentication certificate was not created'
134
     rm -rf /home/$USERNAME/emailcert
134
     rm -rf /home/$USERNAME/emailcert
135
     exit 343569
135
     exit 343569
136
 fi
136
 fi
167
 
167
 
168
 shred -zu /etc/ssl/requests/$USERNAME.csr
168
 shred -zu /etc/ssl/requests/$USERNAME.csr
169
 
169
 
170
-echo 'Email authentication certificate created. You can obtain it on the client with:'
170
+echo $'Email authentication certificate created. You can obtain it on the client with:'
171
 echo ''
171
 echo ''
172
 echo "      scp -P 2222 -r $USERNAME@$HOSTNAME:/home/$USERNAME/emailcert ~/"
172
 echo "      scp -P 2222 -r $USERNAME@$HOSTNAME:/home/$USERNAME/emailcert ~/"
173
 echo ''
173
 echo ''

+ 7
- 7
src/freedombone-format Näytä tiedosto

34
 export TEXTDOMAINDIR="/usr/share/locale"
34
 export TEXTDOMAINDIR="/usr/share/locale"
35
 
35
 
36
 if [ ! $1 ]; then
36
 if [ ! $1 ]; then
37
-   echo 'Specify a drive, such as sdb, sdc, etc'
37
+   echo $'Specify a drive, such as sdb, sdc, etc'
38
    exit 1
38
    exit 1
39
 fi
39
 fi
40
 
40
 
41
 USB_DRIVE=/dev/${1}1
41
 USB_DRIVE=/dev/${1}1
42
 LABEL='Freedombone'
42
 LABEL='Freedombone'
43
 
43
 
44
-echo 'Partitioning drive'
44
+echo $'Partitioning drive'
45
 echo "o
45
 echo "o
46
 d
46
 d
47
 2
47
 2
57
 w
57
 w
58
 " | fdisk /dev/${1};mkfs.ext4 -L "$LABEL" /dev/${1}1
58
 " | fdisk /dev/${1};mkfs.ext4 -L "$LABEL" /dev/${1}1
59
 
59
 
60
-echo "Formatting $USB_DRIVE as LUKS"
60
+echo $"Formatting $USB_DRIVE as LUKS"
61
 cryptsetup -y -v luksFormat ${USB_DRIVE}
61
 cryptsetup -y -v luksFormat ${USB_DRIVE}
62
 if [ ! "$?" = "0" ]; then
62
 if [ ! "$?" = "0" ]; then
63
-    echo "Failed to format $USB_DRIVE as LUKS"
63
+    echo $"Failed to format $USB_DRIVE as LUKS"
64
     exit 36823
64
     exit 36823
65
 fi
65
 fi
66
 cryptsetup luksOpen ${USB_DRIVE} encrypted_usb
66
 cryptsetup luksOpen ${USB_DRIVE} encrypted_usb
67
 if [ ! "$?" = "0" ]; then
67
 if [ ! "$?" = "0" ]; then
68
-    echo "Failed to open LUKS formatted drive $USB_DRIVE"
68
+    echo $"Failed to open LUKS formatted drive $USB_DRIVE"
69
     exit 37232
69
     exit 37232
70
 fi
70
 fi
71
 mkfs.ext4 /dev/mapper/encrypted_usb -L Freedombone
71
 mkfs.ext4 /dev/mapper/encrypted_usb -L Freedombone
72
 if [ ! "$?" = "0" ]; then
72
 if [ ! "$?" = "0" ]; then
73
     cryptsetup luksClose encrypted_usb
73
     cryptsetup luksClose encrypted_usb
74
-    echo 'Format of drive $USB_DRIVE failed'
74
+    echo $'Format of drive $USB_DRIVE failed'
75
     exit 73218
75
     exit 73218
76
 fi
76
 fi
77
 sleep 2
77
 sleep 2
79
 if [ -f /dev/mapper/encrypted_usb ]; then
79
 if [ -f /dev/mapper/encrypted_usb ]; then
80
     rm -rf /dev/mapper/encrypted_usb
80
     rm -rf /dev/mapper/encrypted_usb
81
 fi
81
 fi
82
-echo 'Format completed'
82
+echo $'Format completed'
83
 exit 0
83
 exit 0

+ 1
- 1
src/freedombone-ignore Näytä tiedosto

41
 
41
 
42
 function show_help {
42
 function show_help {
43
     echo ''
43
     echo ''
44
-    echo 'freedombone-ignore -u [username] -e [mail address] -t [text in subject line]'
44
+    echo $'freedombone-ignore -u [username] -e [mail address] -t [text in subject line]'
45
     echo ''
45
     echo ''
46
     exit 0
46
     exit 0
47
 }
47
 }

+ 10
- 10
src/freedombone-image Näytä tiedosto

84
     shift
84
     shift
85
     CONFIG_FILENAME="$1"
85
     CONFIG_FILENAME="$1"
86
     if [ ! -f $CONFIG_FILENAME ]; then
86
     if [ ! -f $CONFIG_FILENAME ]; then
87
-        echo "Config file $CONFIG_FILENAME not found"
87
+        echo $"Config file $CONFIG_FILENAME not found"
88
         exit 3
88
         exit 3
89
     fi
89
     fi
90
     DEFAULT_DOMAIN_NAME=$(cat $CONFIG_FILENAME | grep 'DEFAULT_DOMAIN_NAME' | awk -F '=' '{print $2}')
90
     DEFAULT_DOMAIN_NAME=$(cat $CONFIG_FILENAME | grep 'DEFAULT_DOMAIN_NAME' | awk -F '=' '{print $2}')
101
     shift
101
     shift
102
     PASSWORD="$1"
102
     PASSWORD="$1"
103
     if [ ${#PASSWORD} -lt $MINIMUM_PASSWORD_LENGTH ]; then
103
     if [ ${#PASSWORD} -lt $MINIMUM_PASSWORD_LENGTH ]; then
104
-        echo "Your password chould contain at least ${MINIMUM_PASSWORD_LENGTH} characters"
104
+        echo $"Your password chould contain at least ${MINIMUM_PASSWORD_LENGTH} characters"
105
         exit 3628
105
         exit 3628
106
     fi
106
     fi
107
     ;;
107
     ;;
201
     GENERIC_IMAGE="$GENERIC_IMAGE"
201
     GENERIC_IMAGE="$GENERIC_IMAGE"
202
 
202
 
203
 if [ ! "$?" = "0" ]; then
203
 if [ ! "$?" = "0" ]; then
204
-    echo 'Build failed'
204
+    echo $'Build failed'
205
     rm -rf $BUILD_DIR
205
     rm -rf $BUILD_DIR
206
     exit 1
206
     exit 1
207
 fi
207
 fi
217
 shopt -s nullglob
217
 shopt -s nullglob
218
 imgfiles=(build/${PROJECT_NAME}*.${EXPECTED_EXTENSION})
218
 imgfiles=(build/${PROJECT_NAME}*.${EXPECTED_EXTENSION})
219
 if [ ${#imgfiles[@]} -eq 0 ]; then
219
 if [ ${#imgfiles[@]} -eq 0 ]; then
220
-    echo 'Image was not created'
220
+    echo $'Image was not created'
221
     rm -rf $BUILD_DIR
221
     rm -rf $BUILD_DIR
222
     exit 2
222
     exit 2
223
 fi
223
 fi
232
 cd ${CURR_DIR}
232
 cd ${CURR_DIR}
233
 
233
 
234
 clear
234
 clear
235
-echo "
235
+echo $"
236
 Image was created.
236
 Image was created.
237
 
237
 
238
 You will be able to log into it with:
238
 You will be able to log into it with:
239
 "
239
 "
240
 if [[ $IMAGE_TYPE != "virtualbox"* && $IMAGE_TYPE != "qemu"* ]]; then
240
 if [[ $IMAGE_TYPE != "virtualbox"* && $IMAGE_TYPE != "qemu"* ]]; then
241
-    echo "    ssh $USERNAME@$DEFAULT_DOMAIN_NAME -p 2222
241
+    echo $"    ssh $USERNAME@$DEFAULT_DOMAIN_NAME -p 2222
242
 
242
 
243
     Password: $PASSWORD
243
     Password: $PASSWORD
244
 "
244
 "
245
 else
245
 else
246
     if [[ $IMAGE_TYPE != "qemu"* ]]; then
246
     if [[ $IMAGE_TYPE != "qemu"* ]]; then
247
-        echo "    Username: $USERNAME
247
+        echo $"    Username: $USERNAME
248
     Password: $PASSWORD
248
     Password: $PASSWORD
249
 "
249
 "
250
     else
250
     else
253
         else
253
         else
254
             echo "qemu-system-x86_64 $(ls ${PROJECT_NAME}*.qcow2)"
254
             echo "qemu-system-x86_64 $(ls ${PROJECT_NAME}*.qcow2)"
255
         fi
255
         fi
256
-        echo "
256
+        echo $"
257
     Username: $USERNAME
257
     Username: $USERNAME
258
     Password: $PASSWORD
258
     Password: $PASSWORD
259
 "
259
 "
262
 ls -lh ${PROJECT_NAME}*.img ${PROJECT_NAME}*.sig ${PROJECT_NAME}*.bz2 ${PROJECT_NAME}*.vdi ${PROJECT_NAME}*.qcow2
262
 ls -lh ${PROJECT_NAME}*.img ${PROJECT_NAME}*.sig ${PROJECT_NAME}*.bz2 ${PROJECT_NAME}*.vdi ${PROJECT_NAME}*.qcow2
263
 
263
 
264
 # record the default login credentials for later use
264
 # record the default login credentials for later use
265
-echo "Username: $USERNAME
265
+echo $"Username: $USERNAME
266
 Password: $PASSWORD" > ${CURR_DIR}/${PROJECT_NAME}_login_credentials.txt
266
 Password: $PASSWORD" > ${CURR_DIR}/${PROJECT_NAME}_login_credentials.txt
267
 chmod 600 ${CURR_DIR}/${PROJECT_NAME}_login_credentials.txt
267
 chmod 600 ${CURR_DIR}/${PROJECT_NAME}_login_credentials.txt
268
 
268
 
269
 if [[ $IMAGE_TYPE != "virtualbox"* && $IMAGE_TYPE != "qemu"* ]]; then
269
 if [[ $IMAGE_TYPE != "virtualbox"* && $IMAGE_TYPE != "qemu"* ]]; then
270
     echo ''
270
     echo ''
271
-    echo 'You can copy the image to a microSD card with:'
271
+    echo $'You can copy the image to a microSD card with:'
272
     echo ''
272
     echo ''
273
     echo "    sudo dd bs=1M if=$(ls ${PROJECT_NAME}*.img) of=/dev/sdX conv=fdatasync"
273
     echo "    sudo dd bs=1M if=$(ls ${PROJECT_NAME}*.img) of=/dev/sdX conv=fdatasync"
274
     echo ''
274
     echo ''

+ 9
- 9
src/freedombone-image-customise Näytä tiedosto

60
     chroot $rootdir apt-get install --no-install-recommends -y eatmydata
60
     chroot $rootdir apt-get install --no-install-recommends -y eatmydata
61
     if [ -x $rootdir/usr/bin/eatmydata ] && \
61
     if [ -x $rootdir/usr/bin/eatmydata ] && \
62
         [ ! -f $rootdir/etc/apt/apt.conf.d/95debian-edu-install-dpkg-eatmydata ]; then
62
         [ ! -f $rootdir/etc/apt/apt.conf.d/95debian-edu-install-dpkg-eatmydata ]; then
63
-        echo "info: Adding apt config to call dpkg via eatmydata"
63
+        echo $"info: Adding apt config to call dpkg via eatmydata"
64
         printf "#!/bin/sh\nexec eatmydata dpkg \"\$@\"\n" \
64
         printf "#!/bin/sh\nexec eatmydata dpkg \"\$@\"\n" \
65
             > $rootdir/var/tmp/dpkg-eatmydata
65
             > $rootdir/var/tmp/dpkg-eatmydata
66
         chmod 755 $rootdir/var/tmp/dpkg-eatmydata
66
         chmod 755 $rootdir/var/tmp/dpkg-eatmydata
68
 Dir::Bin::dpkg "/var/tmp/dpkg-eatmydata";
68
 Dir::Bin::dpkg "/var/tmp/dpkg-eatmydata";
69
 EOF
69
 EOF
70
     else
70
     else
71
-        echo "error: unable to find /usr/bin/eatmydata after installing the eatmydata package"
71
+        echo $"error: unable to find /usr/bin/eatmydata after installing the eatmydata package"
72
     fi
72
     fi
73
 }
73
 }
74
 
74
 
76
     for override in \
76
     for override in \
77
         /etc/apt/apt.conf.d/95debian-edu-install-dpkg-eatmydata \
77
         /etc/apt/apt.conf.d/95debian-edu-install-dpkg-eatmydata \
78
         /var/tmp/dpkg-eatmydata ; do
78
         /var/tmp/dpkg-eatmydata ; do
79
-        echo "info: Removing apt config to call dpkg via eatmydata"
79
+        echo $"info: Removing apt config to call dpkg via eatmydata"
80
         if [ -f $rootdir$override ] ; then
80
         if [ -f $rootdir$override ] ; then
81
             rm -f $rootdir$override
81
             rm -f $rootdir$override
82
         else
82
         else
83
-            echo "warning: missing $rootdir$override"
83
+            echo $"warning: missing $rootdir$override"
84
         fi
84
         fi
85
     done
85
     done
86
     sync # Flush file buffers before continuing
86
     sync # Flush file buffers before continuing
151
     sed -i "/nameserver $NAMESERVER1/a\nameserver $NAMESERVER2" $rootdir/etc/resolv.conf
151
     sed -i "/nameserver $NAMESERVER1/a\nameserver $NAMESERVER2" $rootdir/etc/resolv.conf
152
 
152
 
153
     # change the motd to show further install instructions
153
     # change the motd to show further install instructions
154
-    echo "
154
+    echo $"
155
  .---.                  .              .
155
  .---.                  .              .
156
  |                      |              |
156
  |                      |              |
157
  |--- .--. .-.  .-.  .-.|  .-. .--.--. |.-.  .-. .--.  .-.
157
  |--- .--. .-.  .-.  .-.|  .-. .--.--. |.-.  .-. .--.  .-.
179
         echo "$SSH_PUBKEY" > $rootdir/home/$MY_USERNAME/.ssh/authorized_keys
179
         echo "$SSH_PUBKEY" > $rootdir/home/$MY_USERNAME/.ssh/authorized_keys
180
         chroot $rootdir chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.ssh
180
         chroot $rootdir chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.ssh
181
         sed -i 's|PasswordAuthentication.*|PasswordAuthentication no|g' $rootdir/etc/ssh/sshd_config
181
         sed -i 's|PasswordAuthentication.*|PasswordAuthentication no|g' $rootdir/etc/ssh/sshd_config
182
-        echo "Using ssh public key:"
182
+        echo $"Using ssh public key:"
183
         echo $SSH_PUBKEY
183
         echo $SSH_PUBKEY
184
-        echo 'Password ssh authentication turned off'
184
+        echo $'Password ssh authentication turned off'
185
     fi
185
     fi
186
 }
186
 }
187
 
187
 
300
 export TMP=/tmp/ TMPDIR=/tmp/
300
 export TMP=/tmp/ TMPDIR=/tmp/
301
 
301
 
302
 username=$MY_USERNAME
302
 username=$MY_USERNAME
303
-echo "warning: creating initial user $username with well known password!"
303
+echo $"warning: creating initial user $username with well known password!"
304
 password=$MY_PASSWORD
304
 password=$MY_PASSWORD
305
 chroot "$rootdir" adduser --gecos $username --disabled-password $username
305
 chroot "$rootdir" adduser --gecos $username --disabled-password $username
306
 echo $username:$password | chroot $rootdir /usr/sbin/chpasswd
306
 echo $username:$password | chroot $rootdir /usr/sbin/chpasswd
389
 continue_installation
389
 continue_installation
390
 
390
 
391
 cd /
391
 cd /
392
-echo "info: killing leftover processes in chroot"
392
+echo $"info: killing leftover processes in chroot"
393
 fuser -mvk $rootdir/. || true
393
 fuser -mvk $rootdir/. || true

+ 1
- 1
src/freedombone-image-hardware-setup Näytä tiedosto

34
 enable_serial_console() {
34
 enable_serial_console() {
35
     # By default, spawn a console on the serial port
35
     # By default, spawn a console on the serial port
36
     device="$1"
36
     device="$1"
37
-    echo "Adding a getty on the serial port"
37
+    echo $"Adding a getty on the serial port"
38
     echo "T0:12345:respawn:/sbin/getty -L $device 115200 vt100" >> /etc/inittab
38
     echo "T0:12345:respawn:/sbin/getty -L $device 115200 vt100" >> /etc/inittab
39
 }
39
 }
40
 
40
 

+ 4
- 4
src/freedombone-image-make Näytä tiedosto

58
 vmdebootstrap_dir="${vendor_dir}/vmdebootstrap"
58
 vmdebootstrap_dir="${vendor_dir}/vmdebootstrap"
59
 
59
 
60
 if [ -z "$MIRROR" ] || [ -z "$SUITE" ] ; then
60
 if [ -z "$MIRROR" ] || [ -z "$SUITE" ] ; then
61
-    echo error: Missing MIRROR and SUITE settings inherited from Makefile.
61
+    echo $"error: Missing MIRROR and SUITE settings inherited from Makefile."
62
     exit 1
62
     exit 1
63
 fi
63
 fi
64
 
64
 
145
     VMDEBOOTSTRAP=vmdebootstrap
145
     VMDEBOOTSTRAP=vmdebootstrap
146
 fi
146
 fi
147
 
147
 
148
-echo 'Making customised customisation script'
148
+echo $'Making customised customisation script'
149
 TEMP_CUSTOMISE=/etc/${PROJECT_NAME}/image-customise
149
 TEMP_CUSTOMISE=/etc/${PROJECT_NAME}/image-customise
150
 if [ -f /usr/local/bin/${PROJECT_NAME}-image-customise ]; then
150
 if [ -f /usr/local/bin/${PROJECT_NAME}-image-customise ]; then
151
     sudo cp /usr/local/bin/${PROJECT_NAME}-image-customise $TEMP_CUSTOMISE
151
     sudo cp /usr/local/bin/${PROJECT_NAME}-image-customise $TEMP_CUSTOMISE
163
 sudo sed -i "s|SSH_PUBKEY=.*|SSH_PUBKEY=${SSH_PUBKEY}|g" $TEMP_CUSTOMISE
163
 sudo sed -i "s|SSH_PUBKEY=.*|SSH_PUBKEY=${SSH_PUBKEY}|g" $TEMP_CUSTOMISE
164
 sudo sed -i "s|GENERIC_IMAGE=.*|GENERIC_IMAGE=${GENERIC_IMAGE}|g" $TEMP_CUSTOMISE
164
 sudo sed -i "s|GENERIC_IMAGE=.*|GENERIC_IMAGE=${GENERIC_IMAGE}|g" $TEMP_CUSTOMISE
165
 
165
 
166
-echo "starting $VMDEBOOTSTRAP"
166
+echo $"starting $VMDEBOOTSTRAP"
167
 # Run vmdebootstrap script to create image
167
 # Run vmdebootstrap script to create image
168
 sudo -H \
168
 sudo -H \
169
     SUITE="$SUITE" \
169
     SUITE="$SUITE" \
188
     $extra_opts \
188
     $extra_opts \
189
     $pkgopts
189
     $pkgopts
190
 
190
 
191
-echo 'Removing customised customisation script'
191
+echo $'Removing customised customisation script'
192
 sudo shred -zu $TEMP_CUSTOMISE
192
 sudo shred -zu $TEMP_CUSTOMISE

+ 19
- 19
src/freedombone-keydrive Näytä tiedosto

43
 
43
 
44
 function show_help {
44
 function show_help {
45
     echo ''
45
     echo ''
46
-    echo 'freedombone-keydrive -u [username] -d [device, eg. sdb] --master [yes/no] -n [no of fragments] --format [yes/no]'
46
+    echo $'freedombone-keydrive -u [username] -d [device, eg. sdb] --master [yes/no] -n [no of fragments] --format [yes/no]'
47
     echo ''
47
     echo ''
48
     exit 0
48
     exit 0
49
 }
49
 }
84
 done
84
 done
85
 
85
 
86
 if [ ! $MY_USERNAME ]; then
86
 if [ ! $MY_USERNAME ]; then
87
-    echo 'No username given'
87
+    echo $'No username given'
88
     exit 69350
88
     exit 69350
89
 fi
89
 fi
90
 
90
 
91
 if [ ! -d /home/$MY_USERNAME ]; then
91
 if [ ! -d /home/$MY_USERNAME ]; then
92
-    echo "Home directory for $MY_USERNAME not found. This user may not exist on the system"
92
+    echo $"Home directory for $MY_USERNAME not found. This user may not exist on the system"
93
     exit 72378
93
     exit 72378
94
 fi
94
 fi
95
 
95
 
96
 if [ ! -b $USB_DRIVE ]; then
96
 if [ ! -b $USB_DRIVE ]; then
97
-  echo 'Please attach a USB drive'
97
+  echo $'Please attach a USB drive'
98
   exit 65743
98
   exit 65743
99
 fi
99
 fi
100
 
100
 
121
 fi
121
 fi
122
 mount $USB_DRIVE $USB_MOUNT
122
 mount $USB_DRIVE $USB_MOUNT
123
 if [ ! "$?" = "0" ]; then
123
 if [ ! "$?" = "0" ]; then
124
-  echo "There was a problem mounting the USB drive to $USB_MOUNT"
124
+  echo $"There was a problem mounting the USB drive to $USB_MOUNT"
125
   rm -rf $USB_MOUNT
125
   rm -rf $USB_MOUNT
126
   exit 78543
126
   exit 78543
127
 fi
127
 fi
129
 # optionally create a master drive which contains the full GPG keyring
129
 # optionally create a master drive which contains the full GPG keyring
130
 if [[ $MASTER_DRIVE == "yes" || $MASTER_DRIVE == "y" || $MASTER_DRIVE == "1" ]]; then
130
 if [[ $MASTER_DRIVE == "yes" || $MASTER_DRIVE == "y" || $MASTER_DRIVE == "1" ]]; then
131
   if [ ! -d /home/$MY_USERNAME/.gnupg ]; then
131
   if [ ! -d /home/$MY_USERNAME/.gnupg ]; then
132
-      echo "No .gnupg directory was found for $MY_USERNAME"
132
+      echo $"No .gnupg directory was found for $MY_USERNAME"
133
       umount -f $USB_MOUNT
133
       umount -f $USB_MOUNT
134
       rm -rf $USB_MOUNT
134
       rm -rf $USB_MOUNT
135
       exit 73025
135
       exit 73025
136
   fi
136
   fi
137
   cp -rf /home/$MY_USERNAME/.gnupg $USB_MOUNT
137
   cp -rf /home/$MY_USERNAME/.gnupg $USB_MOUNT
138
   if [ -d $USB_MOUNT/.gnupg ]; then
138
   if [ -d $USB_MOUNT/.gnupg ]; then
139
-      echo "GPG Keyring copied to $USB_DRIVE. You may now remove the drive."
139
+      echo $"GPG Keyring copied to $USB_DRIVE. You may now remove the drive."
140
   else
140
   else
141
-      echo "Unable to copy gpg keyring to $USB_DRIVE"
141
+      echo $"Unable to copy gpg keyring to $USB_DRIVE"
142
   fi
142
   fi
143
   umount -f $USB_MOUNT
143
   umount -f $USB_MOUNT
144
   rm -rf $USB_MOUNT
144
   rm -rf $USB_MOUNT
147
 
147
 
148
 # Don't use the USB drive if it already contains a full keyring
148
 # Don't use the USB drive if it already contains a full keyring
149
 if [ -d $USB_MOUNT/.gnupg ]; then
149
 if [ -d $USB_MOUNT/.gnupg ]; then
150
-  echo 'A full GPG keyring already exists on the USB drive.'
151
-  echo 'Either reformat the USB drive or use a different drive.'
150
+  echo $'A full GPG keyring already exists on the USB drive.'
151
+  echo $'Either reformat the USB drive or use a different drive.'
152
   umount -f $USB_MOUNT
152
   umount -f $USB_MOUNT
153
   rm -rf $USB_MOUNT
153
   rm -rf $USB_MOUNT
154
   exit 3392
154
   exit 3392
164
 # make a directory to contain the fragments
164
 # make a directory to contain the fragments
165
 if [ ! -d $FRAGMENTS_DIR ]; then
165
 if [ ! -d $FRAGMENTS_DIR ]; then
166
   mkdir -p $FRAGMENTS_DIR
166
   mkdir -p $FRAGMENTS_DIR
167
-  echo "Made directory $FRAGMENTS_DIR"
167
+  echo $"Made directory $FRAGMENTS_DIR"
168
 fi
168
 fi
169
 if [ ! -d $FRAGMENTS_DIR ]; then
169
 if [ ! -d $FRAGMENTS_DIR ]; then
170
-  echo "There was a problem making the directory $FRAGMENTS_DIR"
170
+  echo $"There was a problem making the directory $FRAGMENTS_DIR"
171
   umount -f $USB_MOUNT
171
   umount -f $USB_MOUNT
172
   rm -rf $USB_MOUNT
172
   rm -rf $USB_MOUNT
173
   exit 6843
173
   exit 6843
179
     no_of_usb_shares=0
179
     no_of_usb_shares=0
180
 fi
180
 fi
181
 if (( no_of_usb_shares > 0 )); then
181
 if (( no_of_usb_shares > 0 )); then
182
-    echo "A key fragment already exists on the drive for the user $MY_USERNAME"
182
+    echo $"A key fragment already exists on the drive for the user $MY_USERNAME"
183
     cd ~/
183
     cd ~/
184
     umount -f $USB_MOUNT
184
     umount -f $USB_MOUNT
185
     rm -rf $USB_MOUNT
185
     rm -rf $USB_MOUNT
208
 fi
208
 fi
209
 
209
 
210
 if (( no_of_local_shares < 3 )); then
210
 if (( no_of_local_shares < 3 )); then
211
-    echo "Not enough key fragments available ${no_of_local_shares}"
211
+    echo $"Not enough key fragments available ${no_of_local_shares}"
212
     cd ~/
212
     cd ~/
213
     umount -f $USB_MOUNT
213
     umount -f $USB_MOUNT
214
     rm -rf $USB_MOUNT
214
     rm -rf $USB_MOUNT
221
 cp -f $SHARE_FILENAME $FRAGMENTS_DIR
221
 cp -f $SHARE_FILENAME $FRAGMENTS_DIR
222
 cd $FRAGMENTS_DIR
222
 cd $FRAGMENTS_DIR
223
 no_of_usb_shares=$(ls -afq keyshare.asc.* | wc -l)
223
 no_of_usb_shares=$(ls -afq keyshare.asc.* | wc -l)
224
-echo "Number of fragments on the drive: ${no_of_usb_shares}"
224
+echo $"Number of fragments on the drive: ${no_of_usb_shares}"
225
 if (( no_of_usb_shares > 1 )); then
225
 if (( no_of_usb_shares > 1 )); then
226
-    echo "Too many key fragments exist in $FRAGMENTS_DIR"
226
+    echo $"Too many key fragments exist in $FRAGMENTS_DIR"
227
     ls $FRAGMENTS_DIR
227
     ls $FRAGMENTS_DIR
228
     cd ~/
228
     cd ~/
229
     umount -f $USB_MOUNT
229
     umount -f $USB_MOUNT
231
     exit 54292
231
     exit 54292
232
 fi
232
 fi
233
 if (( no_of_usb_shares <= 0 )); then
233
 if (( no_of_usb_shares <= 0 )); then
234
-    echo "There was a problem copying the key fragment to $USB_DRIVE"
235
-    echo "Files found: ${no_of_usb_shares}"
234
+    echo $"There was a problem copying the key fragment to $USB_DRIVE"
235
+    echo $"Files found: ${no_of_usb_shares}"
236
     ls $FRAGMENTS_DIR
236
     ls $FRAGMENTS_DIR
237
     cd ~/
237
     cd ~/
238
     umount -f $USB_MOUNT
238
     umount -f $USB_MOUNT
243
 cd ~/
243
 cd ~/
244
 umount -f $USB_MOUNT
244
 umount -f $USB_MOUNT
245
 rm -rf $USB_MOUNT
245
 rm -rf $USB_MOUNT
246
-echo "Key fragment copied to $USB_DRIVE. You may now remove the drive."
246
+echo $"Key fragment copied to $USB_DRIVE. You may now remove the drive."
247
 
247
 
248
 exit 0
248
 exit 0

+ 27
- 27
src/freedombone-mesh Näytä tiedosto

79
     sudo cp /usr/local/lib/libtoxcore* /usr/lib/
79
     sudo cp /usr/local/lib/libtoxcore* /usr/lib/
80
 
80
 
81
     if [ ! -f /usr/local/bin/tox-bootstrapd ]; then
81
     if [ ! -f /usr/local/bin/tox-bootstrapd ]; then
82
-        echo "File not found /usr/local/bin/tox-bootstrapd"
82
+        echo $"File not found /usr/local/bin/tox-bootstrapd"
83
         exit 73862
83
         exit 73862
84
     fi
84
     fi
85
 
85
 
86
     sudo useradd --home-dir /var/lib/tox-bootstrapd --create-home --system --shell /sbin/nologin --comment "Account to run Tox's DHT bootstrap daemon" --user-group tox-bootstrapd
86
     sudo useradd --home-dir /var/lib/tox-bootstrapd --create-home --system --shell /sbin/nologin --comment "Account to run Tox's DHT bootstrap daemon" --user-group tox-bootstrapd
87
     sudo chmod 700 /var/lib/tox-bootstrapd
87
     sudo chmod 700 /var/lib/tox-bootstrapd
88
     if [ ! -f ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.conf ]; then
88
     if [ ! -f ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.conf ]; then
89
-        echo "File not found $INSTALL_DIR/toxcore/other/bootstrap_daemon/tox-bootstrapd.conf"
89
+        echo $"File not found $INSTALL_DIR/toxcore/other/bootstrap_daemon/tox-bootstrapd.conf"
90
         exit 476835
90
         exit 476835
91
     fi
91
     fi
92
 
92
 
106
 
106
 
107
     if [ -f /bin/systemctl ]; then
107
     if [ -f /bin/systemctl ]; then
108
         if [ ! -f ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service ]; then
108
         if [ ! -f ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service ]; then
109
-            echo "File not found ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service"
109
+            echo $"File not found ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service"
110
             exit 7359
110
             exit 7359
111
         fi
111
         fi
112
         sudo cp ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service /etc/systemd/system/
112
         sudo cp ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service /etc/systemd/system/
129
 
129
 
130
     TOX_PUBLIC_KEY=$(cat /var/log/syslog | grep tox | grep "Public Key" | awk -F ' ' '{print $8}' | tail -1)
130
     TOX_PUBLIC_KEY=$(cat /var/log/syslog | grep tox | grep "Public Key" | awk -F ' ' '{print $8}' | tail -1)
131
     if [ ${#TOX_PUBLIC_KEY} -lt 30 ]; then
131
     if [ ${#TOX_PUBLIC_KEY} -lt 30 ]; then
132
-        echo 'Could not obtain the tox node public key'
132
+        echo $'Could not obtain the tox node public key'
133
         exit 6529
133
         exit 6529
134
     fi
134
     fi
135
 
135
 
149
     sudo make install
149
     sudo make install
150
 
150
 
151
     if [ ! -f /usr/local/bin/toxid ]; then
151
     if [ ! -f /usr/local/bin/toxid ]; then
152
-        echo "Couldn't install toxid"
152
+        echo $"Couldn't install toxid"
153
         exit 6389
153
         exit 6389
154
     fi
154
     fi
155
 
155
 
178
         # get a list of peers
178
         # get a list of peers
179
         PEER_TOX_ID_LIST=$(lstox | grep $AVAHI_DOMAIN | sort -u)
179
         PEER_TOX_ID_LIST=$(lstox | grep $AVAHI_DOMAIN | sort -u)
180
         if [ ! "$PEER_TOX_ID_LIST" ]; then
180
         if [ ! "$PEER_TOX_ID_LIST" ]; then
181
-            echo 'No peers found'
181
+            echo $'No peers found'
182
             exit 0
182
             exit 0
183
         fi
183
         fi
184
         PEER_TOX_ID_LIST_COUNT=$(echo "$PEER_TOX_ID_LIST" | wc -l)
184
         PEER_TOX_ID_LIST_COUNT=$(echo "$PEER_TOX_ID_LIST" | wc -l)
189
         else
189
         else
190
             # choose a user from a list
190
             # choose a user from a list
191
             echo ''
191
             echo ''
192
-            echo "Select a user on $AVAHI_DOMAIN:"
192
+            echo $"Select a user on $AVAHI_DOMAIN:"
193
             ctr=0
193
             ctr=0
194
             while IFS='' read -r line || [[ -n "$line" ]]; do
194
             while IFS='' read -r line || [[ -n "$line" ]]; do
195
                 toxusername=$(echo $line | awk -F ' ' '{print $2}')
195
                 toxusername=$(echo $line | awk -F ' ' '{print $2}')
204
         if [ ${#PEER_TOX_ID} -gt 30 ]; then
204
         if [ ${#PEER_TOX_ID} -gt 30 ]; then
205
             # start client and make a friend request
205
             # start client and make a friend request
206
             if [ -f $QTOX_INI ]; then
206
             if [ -f $QTOX_INI ]; then
207
-                echo 'Launch qTox'
207
+                echo $'Launch qTox'
208
                 qtox &
208
                 qtox &
209
             else
209
             else
210
 
210
 
220
         else
220
         else
221
             # ID was invalid
221
             # ID was invalid
222
             echo $PEER_TOX_ID
222
             echo $PEER_TOX_ID
223
-            echo "Tox ID for $AVAHI_DOMAIN was not found"
223
+            echo $"Tox ID for $AVAHI_DOMAIN was not found"
224
             exit 6
224
             exit 6
225
         fi
225
         fi
226
     fi
226
     fi
258
 avahi-browse -atl | awk -F ' ' '{print $4}' | sort -u > $PEERS_FILE
258
 avahi-browse -atl | awk -F ' ' '{print $4}' | sort -u > $PEERS_FILE
259
 
259
 
260
 if [ ! -f $PEERS_FILE ]; then
260
 if [ ! -f $PEERS_FILE ]; then
261
-   echo 'No peers were found'
261
+   echo $'No peers were found'
262
    exit 0
262
    exit 0
263
 fi
263
 fi
264
 
264
 
268
 done < "$PEERS_FILE"
268
 done < "$PEERS_FILE"
269
 
269
 
270
 if [ ${ctr} -lt "1" ]; then
270
 if [ ${ctr} -lt "1" ]; then
271
-   echo 'No peers were found'
271
+   echo $'No peers were found'
272
    exit 0
272
    exit 0
273
 fi
273
 fi
274
 
274
 
279
 echo "|--- .--. .-.  .-.  .-.|  .-. .--.--. |.-.  .-. .--.  .-. "
279
 echo "|--- .--. .-.  .-.  .-.|  .-. .--.--. |.-.  .-. .--.  .-. "
280
 echo "|    |   (.-' (.-' (   | (   )|  |  | |   )(   )|  | (.-' "
280
 echo "|    |   (.-' (.-' (   | (   )|  |  | |   )(   )|  | (.-' "
281
 echo "'    '     --'  --'  -' -  -' '  '   -' -'   -' '   -  --'"
281
 echo "'    '     --'  --'  -' -  -' '  '   -' -'   -' '   -  --'"
282
-echo '                    Freedom in the Mesh'
282
+echo $'                    Freedom in the Mesh'
283
 echo ''
283
 echo ''
284
-echo 'Please choose a peer to connect to:'
284
+echo $'Please choose a peer to connect to:'
285
 idx=1
285
 idx=1
286
 while IFS='' read -r line || [[ -n "$line" ]]; do
286
 while IFS='' read -r line || [[ -n "$line" ]]; do
287
     echo "    $idx. $line"
287
     echo "    $idx. $line"
293
 
293
 
294
 # if no selection made
294
 # if no selection made
295
 if [ ! $peer_index ]; then
295
 if [ ! $peer_index ]; then
296
-    echo 'Nothing was selected'
296
+    echo $'Nothing was selected'
297
     echo ''
297
     echo ''
298
     exit 0
298
     exit 0
299
 fi
299
 fi
309
 done < "$PEERS_FILE"
309
 done < "$PEERS_FILE"
310
 
310
 
311
 if [ ! $AVAHI_DOMAIN ]; then
311
 if [ ! $AVAHI_DOMAIN ]; then
312
-    echo 'No domain name'
312
+    echo $'No domain name'
313
     exit 3
313
     exit 3
314
 fi
314
 fi
315
 
315
 
319
         $MUMBLE_PATH &
319
         $MUMBLE_PATH &
320
         exit 0
320
         exit 0
321
     fi
321
     fi
322
-    echo 'You need mumble/toxic/qTox installed on your system'
322
+    echo $'You need mumble/toxic/qTox installed on your system'
323
     if [[ $SERVER_INSTALLATION == "no" ]]; then
323
     if [[ $SERVER_INSTALLATION == "no" ]]; then
324
         sudo batman stop
324
         sudo batman stop
325
     fi
325
     fi
332
 fi
332
 fi
333
 
333
 
334
 echo ''
334
 echo ''
335
-echo 'Choose communication service:'
336
-echo '    1. VoIP'
337
-echo '    2. Tox Chat'
335
+echo $'Choose communication service:'
336
+echo $'    1. VoIP'
337
+echo $'    2. Tox Chat'
338
 echo ''
338
 echo ''
339
 
339
 
340
 read peer_index
340
 read peer_index
341
 
341
 
342
 # if no selection made
342
 # if no selection made
343
 if [ ! $peer_index ]; then
343
 if [ ! $peer_index ]; then
344
-    echo 'Nothing was selected'
344
+    echo $'Nothing was selected'
345
     echo ''
345
     echo ''
346
     exit 0
346
     exit 0
347
 fi
347
 fi
349
 if [[ $peer_index == 1 ]]; then
349
 if [[ $peer_index == 1 ]]; then
350
     if [ -f $MUMBLE_PATH ]; then
350
     if [ -f $MUMBLE_PATH ]; then
351
         echo ''
351
         echo ''
352
-        echo 'To setup for the first time click "Add New", then set:'
353
-        echo "    Label:    $AVAHI_DOMAIN"
354
-        echo "    Address:  $AVAHI_DOMAIN"
355
-        echo '    Port:     64738'
356
-        echo "    Username: $USER"
352
+        echo $'To setup for the first time click "Add New", then set:'
353
+        echo $"    Label:    $AVAHI_DOMAIN"
354
+        echo $"    Address:  $AVAHI_DOMAIN"
355
+        echo $'    Port:     64738'
356
+        echo $"    Username: $USER"
357
         echo ''
357
         echo ''
358
-        echo 'Press Enter to continue.'
358
+        echo $'Press Enter to continue.'
359
         echo ''
359
         echo ''
360
         read peer_index
360
         read peer_index
361
         $MUMBLE_PATH &
361
         $MUMBLE_PATH &
362
     else
362
     else
363
-        echo 'Mumble may not be installed on this system'
363
+        echo $'Mumble may not be installed on this system'
364
         exit 5
364
         exit 5
365
     fi
365
     fi
366
 fi
366
 fi

+ 36
- 36
src/freedombone-meshweb Näytä tiedosto

56
   if [ ! -d /home/$MY_USERNAME/.ipfs ]; then
56
   if [ ! -d /home/$MY_USERNAME/.ipfs ]; then
57
       ipfs init -b 4096
57
       ipfs init -b 4096
58
       if [ ! -d /home/$MY_USERNAME/.ipfs ]; then
58
       if [ ! -d /home/$MY_USERNAME/.ipfs ]; then
59
-          echo "IPFS could not be initialised"
59
+          echo $"IPFS could not be initialised"
60
           exit 7358
60
           exit 7358
61
       fi
61
       fi
62
 
62
 
78
 
78
 
79
   IPFS_PEER_ID=$(ipfs id | grep '\"ID\":' | awk -F '\"' '{print $4}')
79
   IPFS_PEER_ID=$(ipfs id | grep '\"ID\":' | awk -F '\"' '{print $4}')
80
   if [ ${#IPFS_PEER_ID} -lt 10 ]; then
80
   if [ ${#IPFS_PEER_ID} -lt 10 ]; then
81
-      echo 'Invalid IPFS peer ID'
81
+      echo $'Invalid IPFS peer ID'
82
       echo "$IPFS_PEER_ID"
82
       echo "$IPFS_PEER_ID"
83
       exit 74782
83
       exit 74782
84
   fi
84
   fi
107
     fi
107
     fi
108
 
108
 
109
     if [ ! -d /etc/avahi ]; then
109
     if [ ! -d /etc/avahi ]; then
110
-        echo 'Avahi is not installed'
110
+        echo $'Avahi is not installed'
111
         exit 736
111
         exit 736
112
     fi
112
     fi
113
 
113
 
116
     cd $ZERONET_DIR
116
     cd $ZERONET_DIR
117
     python zeronet.py --batch siteCreate 2> $ZERONET_DIR/blog.txt
117
     python zeronet.py --batch siteCreate 2> $ZERONET_DIR/blog.txt
118
     if [ ! -f $ZERONET_DIR/blog.txt ]; then
118
     if [ ! -f $ZERONET_DIR/blog.txt ]; then
119
-        echo 'Unable to create blog'
119
+        echo $'Unable to create blog'
120
         exit 479
120
         exit 479
121
     fi
121
     fi
122
     blog_address=$(cat blog.txt | grep "Site address" | awk -F ':' '{print $2}')
122
     blog_address=$(cat blog.txt | grep "Site address" | awk -F ':' '{print $2}')
125
     ZERONET_BLOG_PRIVATE_KEY=${blog_private_key//[[:blank:]]/}
125
     ZERONET_BLOG_PRIVATE_KEY=${blog_private_key//[[:blank:]]/}
126
 
126
 
127
     if [ ${#ZERONET_BLOG_ADDRESS} -lt 20 ]; then
127
     if [ ${#ZERONET_BLOG_ADDRESS} -lt 20 ]; then
128
-        echo "Address:    $ZERONET_BLOG_ADDRESS"
129
-        echo "Public key: $ZERONET_BLOG_PRIVATE_KEY"
130
-        echo 'Unable to create zeronet blog address'
128
+        echo $"Address:    $ZERONET_BLOG_ADDRESS"
129
+        echo $"Public key: $ZERONET_BLOG_PRIVATE_KEY"
130
+        echo $'Unable to create zeronet blog address'
131
         exit 7358
131
         exit 7358
132
     fi
132
     fi
133
 
133
 
134
     if [ ${#ZERONET_BLOG_PRIVATE_KEY} -lt 20 ]; then
134
     if [ ${#ZERONET_BLOG_PRIVATE_KEY} -lt 20 ]; then
135
-        echo "Address:    $ZERONET_BLOG_ADDRESS"
136
-        echo "Public key: $ZERONET_BLOG_PRIVATE_KEY"
137
-        echo 'Unable to create zeronet blog private key'
135
+        echo $"Address:    $ZERONET_BLOG_ADDRESS"
136
+        echo $"Public key: $ZERONET_BLOG_PRIVATE_KEY"
137
+        echo $'Unable to create zeronet blog private key'
138
         exit 1639
138
         exit 1639
139
     fi
139
     fi
140
 
140
 
141
     if [ ! -d "$ZERONET_DIR/data/$ZERONET_BLOG_ADDRESS" ]; then
141
     if [ ! -d "$ZERONET_DIR/data/$ZERONET_BLOG_ADDRESS" ]; then
142
-        echo "Unable to find site directory: $ZERONET_DIR/data/$ZERONET_BLOG_ADDRESS"
142
+        echo $"Unable to find site directory: $ZERONET_DIR/data/$ZERONET_BLOG_ADDRESS"
143
         exit 7638
143
         exit 7638
144
     fi
144
     fi
145
 
145
 
146
     git clone $ZERONET_BLOG_REPO ZeroBlog
146
     git clone $ZERONET_BLOG_REPO ZeroBlog
147
     if [ ! -d $ZERONET_DIR/ZeroBlog ]; then
147
     if [ ! -d $ZERONET_DIR/ZeroBlog ]; then
148
-        echo 'ZeroBlog repo could not be cloned'
148
+        echo $'ZeroBlog repo could not be cloned'
149
         exit 6739
149
         exit 6739
150
     fi
150
     fi
151
 
151
 
152
-    echo "Blog address:     $ZERONET_BLOG_ADDRESS"
153
-    echo "Blog private key: $ZERONET_BLOG_PRIVATE_KEY"
152
+    echo $"Blog address:     $ZERONET_BLOG_ADDRESS"
153
+    echo $"Blog private key: $ZERONET_BLOG_PRIVATE_KEY"
154
     cp -r $ZERONET_DIR/ZeroBlog/* $ZERONET_DIR/data/$ZERONET_BLOG_ADDRESS
154
     cp -r $ZERONET_DIR/ZeroBlog/* $ZERONET_DIR/data/$ZERONET_BLOG_ADDRESS
155
     if [ ! -d $ZERONET_DIR/data/$ZERONET_BLOG_ADDRESS/data ]; then
155
     if [ ! -d $ZERONET_DIR/data/$ZERONET_BLOG_ADDRESS/data ]; then
156
         mkdir $ZERONET_DIR/data/$ZERONET_BLOG_ADDRESS/data
156
         mkdir $ZERONET_DIR/data/$ZERONET_BLOG_ADDRESS/data
184
 
184
 
185
     if ! grep -q "ZeroNet Blog address" /home/$MY_USERNAME/README; then
185
     if ! grep -q "ZeroNet Blog address" /home/$MY_USERNAME/README; then
186
         echo '' >> /home/$MY_USERNAME/README
186
         echo '' >> /home/$MY_USERNAME/README
187
-        echo "ZeroNet Blog address: $ZERONET_BLOG_ADDRESS" >> /home/$MY_USERNAME/README
188
-        echo "ZeroNet Blog private key: $ZERONET_BLOG_PRIVATE_KEY" >> /home/$MY_USERNAME/README
187
+        echo $"ZeroNet Blog address: $ZERONET_BLOG_ADDRESS" >> /home/$MY_USERNAME/README
188
+        echo $"ZeroNet Blog private key: $ZERONET_BLOG_PRIVATE_KEY" >> /home/$MY_USERNAME/README
189
     fi
189
     fi
190
 
190
 
191
-    echo 'Zeronet blog installed'
191
+    echo $'Zeronet blog installed'
192
 }
192
 }
193
 
193
 
194
 function install_zeronet_forum {
194
 function install_zeronet_forum {
201
     fi
201
     fi
202
 
202
 
203
     if [ ! -d /etc/avahi ]; then
203
     if [ ! -d /etc/avahi ]; then
204
-        echo 'Avahi is not installed'
204
+        echo $'Avahi is not installed'
205
         exit 736
205
         exit 736
206
     fi
206
     fi
207
 
207
 
210
     cd $ZERONET_DIR
210
     cd $ZERONET_DIR
211
     python zeronet.py --batch siteCreate 2> $ZERONET_DIR/forum.txt
211
     python zeronet.py --batch siteCreate 2> $ZERONET_DIR/forum.txt
212
     if [ ! -f $ZERONET_DIR/forum.txt ]; then
212
     if [ ! -f $ZERONET_DIR/forum.txt ]; then
213
-        echo 'Unable to create forum'
213
+        echo $'Unable to create forum'
214
         exit 479
214
         exit 479
215
     fi
215
     fi
216
     forum_address=$(cat forum.txt | grep "Site address" | awk -F ':' '{print $2}')
216
     forum_address=$(cat forum.txt | grep "Site address" | awk -F ':' '{print $2}')
219
     ZERONET_FORUM_PRIVATE_KEY=${forum_private_key//[[:blank:]]/}
219
     ZERONET_FORUM_PRIVATE_KEY=${forum_private_key//[[:blank:]]/}
220
 
220
 
221
     if [ ${#ZERONET_FORUM_ADDRESS} -lt 20 ]; then
221
     if [ ${#ZERONET_FORUM_ADDRESS} -lt 20 ]; then
222
-        echo "Address:    $ZERONET_FORUM_ADDRESS"
223
-        echo "Public key: $ZERONET_FORUM_PRIVATE_KEY"
224
-        echo 'Unable to create zeronet forum address'
222
+        echo $"Address:    $ZERONET_FORUM_ADDRESS"
223
+        echo $"Public key: $ZERONET_FORUM_PRIVATE_KEY"
224
+        echo $'Unable to create zeronet forum address'
225
         exit 76352
225
         exit 76352
226
     fi
226
     fi
227
 
227
 
228
     if [ ${#ZERONET_FORUM_PRIVATE_KEY} -lt 20 ]; then
228
     if [ ${#ZERONET_FORUM_PRIVATE_KEY} -lt 20 ]; then
229
-        echo "Address:    $ZERONET_FORUM_ADDRESS"
230
-        echo "Public key: $ZERONET_FORUM_PRIVATE_KEY"
231
-        echo 'Unable to create zeronet forum private key'
229
+        echo $"Address:    $ZERONET_FORUM_ADDRESS"
230
+        echo $"Public key: $ZERONET_FORUM_PRIVATE_KEY"
231
+        echo $'Unable to create zeronet forum private key'
232
         exit 87356
232
         exit 87356
233
     fi
233
     fi
234
 
234
 
235
     if [ ! -d "$ZERONET_DIR/data/$ZERONET_FORUM_ADDRESS" ]; then
235
     if [ ! -d "$ZERONET_DIR/data/$ZERONET_FORUM_ADDRESS" ]; then
236
-        echo "Unable to find site directory: $ZERONET_DIR/data/$ZERONET_FORUM_ADDRESS"
236
+        echo $"Unable to find site directory: $ZERONET_DIR/data/$ZERONET_FORUM_ADDRESS"
237
         exit 7638
237
         exit 7638
238
     fi
238
     fi
239
 
239
 
240
     git clone $ZERONET_FORUM_REPO ZeroTalk
240
     git clone $ZERONET_FORUM_REPO ZeroTalk
241
     if [ ! -d $ZERONET_DIR/ZeroTalk ]; then
241
     if [ ! -d $ZERONET_DIR/ZeroTalk ]; then
242
-        echo 'ZeroTalk repo could not be cloned'
242
+        echo $'ZeroTalk repo could not be cloned'
243
         exit 6739
243
         exit 6739
244
     fi
244
     fi
245
-    echo "Forum address:     $ZERONET_FORUM_ADDRESS"
246
-    echo "Forum private key: $ZERONET_FORUM_PRIVATE_KEY"
245
+    echo $"Forum address:     $ZERONET_FORUM_ADDRESS"
246
+    echo $"Forum private key: $ZERONET_FORUM_PRIVATE_KEY"
247
     cp -r $ZERONET_DIR/ZeroTalk/* $ZERONET_DIR/data/$ZERONET_FORUM_ADDRESS
247
     cp -r $ZERONET_DIR/ZeroTalk/* $ZERONET_DIR/data/$ZERONET_FORUM_ADDRESS
248
     sed -i "s/ZeroBoard/$ZERONET_DEFAULT_FORUM_TITLE/g" $ZERONET_DIR/data/$ZERONET_FORUM_ADDRESS/index.html
248
     sed -i "s/ZeroBoard/$ZERONET_DEFAULT_FORUM_TITLE/g" $ZERONET_DIR/data/$ZERONET_FORUM_ADDRESS/index.html
249
     sed -i "s/ZeroTalk/$ZERONET_DEFAULT_FORUM_TITLE/g" $ZERONET_DIR/data/$ZERONET_FORUM_ADDRESS/index.html
249
     sed -i "s/ZeroTalk/$ZERONET_DEFAULT_FORUM_TITLE/g" $ZERONET_DIR/data/$ZERONET_FORUM_ADDRESS/index.html
274
 
274
 
275
     if ! grep -q "ZeroNet Forum address" /home/$MY_USERNAME/README; then
275
     if ! grep -q "ZeroNet Forum address" /home/$MY_USERNAME/README; then
276
         echo '' >> /home/$MY_USERNAME/README
276
         echo '' >> /home/$MY_USERNAME/README
277
-        echo "ZeroNet Forum address: $ZERONET_FORUM_ADDRESS" >> /home/$MY_USERNAME/README
278
-        echo "ZeroNet Forum private key: $ZERONET_FORUM_PRIVATE_KEY" >> /home/$MY_USERNAME/README
277
+        echo $"ZeroNet Forum address: $ZERONET_FORUM_ADDRESS" >> /home/$MY_USERNAME/README
278
+        echo $"ZeroNet Forum private key: $ZERONET_FORUM_PRIVATE_KEY" >> /home/$MY_USERNAME/README
279
     fi
279
     fi
280
 
280
 
281
-    echo 'Zeronet forum installed'
281
+    echo $'Zeronet forum installed'
282
 }
282
 }
283
 
283
 
284
 function install_web_server {
284
 function install_web_server {
299
     sudo apt-get -y install nginx
299
     sudo apt-get -y install nginx
300
 
300
 
301
     if [ ! -d /etc/nginx ]; then
301
     if [ ! -d /etc/nginx ]; then
302
-        echo 'Unable to install web server'
302
+        echo $'Unable to install web server'
303
         exit 51
303
         exit 51
304
     fi
304
     fi
305
 }
305
 }
362
 avahi-browse -atl | awk -F ' ' '{print $4}' | sort -u > $PEERS_FILE
362
 avahi-browse -atl | awk -F ' ' '{print $4}' | sort -u > $PEERS_FILE
363
 
363
 
364
 if [ ! -f $PEERS_FILE ]; then
364
 if [ ! -f $PEERS_FILE ]; then
365
-   echo 'No peers were found'
365
+   echo $'No peers were found'
366
    exit 0
366
    exit 0
367
 fi
367
 fi
368
 
368
 
374
 rm $PEERS_FILE
374
 rm $PEERS_FILE
375
 
375
 
376
 if [ ${ctr} -lt "1" ]; then
376
 if [ ${ctr} -lt "1" ]; then
377
-   echo 'No peers were found'
377
+   echo $'No peers were found'
378
    exit 0
378
    exit 0
379
 fi
379
 fi
380
 
380
 
381
 if [ ! -d $ZERONET_DIR ]; then
381
 if [ ! -d $ZERONET_DIR ]; then
382
-    echo 'zeronet was not installed'
382
+    echo $'zeronet was not installed'
383
     exit 63
383
     exit 63
384
 fi
384
 fi
385
 cd $ZERONET_DIR
385
 cd $ZERONET_DIR

+ 29
- 29
src/freedombone-prep Näytä tiedosto

71
 
71
 
72
 function show_help {
72
 function show_help {
73
     echo ''
73
     echo ''
74
-    echo 'freedombone-prep -i [image filename] -d [microSD device] --ip [BBB LAN IP address] --iprouter [Router LAN IP address] --mount [mount directory]'
74
+    echo $'freedombone-prep -i [image filename] -d [microSD device] --ip [BBB LAN IP address] --iprouter [Router LAN IP address] --mount [mount directory]'
75
     echo ''
75
     echo ''
76
-    echo 'See the manpage for more details'
76
+    echo $'See the manpage for more details'
77
     echo ''
77
     echo ''
78
 }
78
 }
79
 
79
 
154
     fi
154
     fi
155
 fi
155
 fi
156
 if [ ! -d $MICROSD_MOUNT_POINT ]; then
156
 if [ ! -d $MICROSD_MOUNT_POINT ]; then
157
-    echo "The mount directory $MICROSD_MOUNT_POINT does not exist."
158
-    echo 'Use the --mount option to specify where the microSD gets mounted to.'
157
+    echo $"The mount directory $MICROSD_MOUNT_POINT does not exist."
158
+    echo $'Use the --mount option to specify where the microSD gets mounted to.'
159
     exit 67563
159
     exit 67563
160
 fi
160
 fi
161
 
161
 
214
 
214
 
215
 
215
 
216
 if [ ! $MICROSD_DRIVE ]; then
216
 if [ ! $MICROSD_DRIVE ]; then
217
-    echo 'You need to specify a drive for the connected microSD.'
218
-    echo 'This can most easily be found by removing the microSD, then'
219
-    echo 'running:'
217
+    echo $'You need to specify a drive for the connected microSD.'
218
+    echo $'This can most easily be found by removing the microSD, then'
219
+    echo $'running:'
220
     echo ''
220
     echo ''
221
     echo '  ls /dev/sd*'
221
     echo '  ls /dev/sd*'
222
     echo ''
222
     echo ''
224
     echo ''
224
     echo ''
225
     echo '  ls /dev/mmcblk*'
225
     echo '  ls /dev/mmcblk*'
226
     echo ''
226
     echo ''
227
-    echo 'Then plugging the microSD back in and entering the same command again'
227
+    echo $'Then plugging the microSD back in and entering the same command again'
228
     exit 1
228
     exit 1
229
 fi
229
 fi
230
 
230
 
232
     if [ -b ${MICROSD_DRIVE}p${PARTITION_NUMBER} ]; then
232
     if [ -b ${MICROSD_DRIVE}p${PARTITION_NUMBER} ]; then
233
         PARTITION_NUMBER=p${PARTITION_NUMBER}
233
         PARTITION_NUMBER=p${PARTITION_NUMBER}
234
     else
234
     else
235
-        echo "The microSD drive could not be found at ${MICROSD_DRIVE}1"
235
+        echo $"The microSD drive could not be found at ${MICROSD_DRIVE}1"
236
         exit 2
236
         exit 2
237
     fi
237
     fi
238
 fi
238
 fi
258
         DEBIAN_IMAGE_FILENAME=${files[0]}
258
         DEBIAN_IMAGE_FILENAME=${files[0]}
259
     fi
259
     fi
260
     if [[ $DEBIAN_IMAGE_FILENAME != *".img" ]]; then
260
     if [[ $DEBIAN_IMAGE_FILENAME != *".img" ]]; then
261
-        echo 'Debian image (.img) file expected'
261
+        echo $'Debian image (.img) file expected'
262
         exit 62394
262
         exit 62394
263
     fi
263
     fi
264
     DEBIAN_FILE_NAME=$DEBIAN_IMAGE_FILENAME
264
     DEBIAN_FILE_NAME=$DEBIAN_IMAGE_FILENAME
278
 fi
278
 fi
279
 
279
 
280
 if [ ! -f ~/freedombone/$DEBIAN_FILE_NAME ]; then
280
 if [ ! -f ~/freedombone/$DEBIAN_FILE_NAME ]; then
281
-    echo "Couldn't extract image $DEBIAN_FILE_NAME"
281
+    echo $"Couldn't extract image $DEBIAN_FILE_NAME"
282
     exit 4
282
     exit 4
283
 fi
283
 fi
284
 
284
 
285
 cd ~/freedombone
285
 cd ~/freedombone
286
-echo 'Flashing image. This may take a while.'
286
+echo $'Flashing image. This may take a while.'
287
 #$SUDO dd if=$DEBIAN_FILE_NAME of=$MICROSD_DRIVE
287
 #$SUDO dd if=$DEBIAN_FILE_NAME of=$MICROSD_DRIVE
288
 sync
288
 sync
289
 
289
 
298
 
298
 
299
 if [ ! -b ${MICROSD_DRIVE}${PARTITION_NUMBER} ]; then
299
 if [ ! -b ${MICROSD_DRIVE}${PARTITION_NUMBER} ]; then
300
     echo ''
300
     echo ''
301
-    echo "The microSD drive could not be found at ${MICROSD_DRIVE}${PARTITION_NUMBER}"
302
-    read -p "Wait for the drive to mount then press any key... " -n1 -s
301
+    echo $"The microSD drive could not be found at ${MICROSD_DRIVE}${PARTITION_NUMBER}"
302
+    read -p $"Wait for the drive to mount then press any key... " -n1 -s
303
     if [ ! -b ${MICROSD_DRIVE}${PARTITION_NUMBER} ]; then
303
     if [ ! -b ${MICROSD_DRIVE}${PARTITION_NUMBER} ]; then
304
-        echo "microSD drive not found at ${MICROSD_DRIVE}${PARTITION_NUMBER}"
304
+        echo $"microSD drive not found at ${MICROSD_DRIVE}${PARTITION_NUMBER}"
305
         exit 5
305
         exit 5
306
     fi
306
     fi
307
 fi
307
 fi
308
 
308
 
309
 if [ ! -d $MICROSD_MOUNT_POINT/$ROOTFS ]; then
309
 if [ ! -d $MICROSD_MOUNT_POINT/$ROOTFS ]; then
310
     echo ''
310
     echo ''
311
-    echo "The rootfs partition $MICROSD_MOUNT_POINT/$ROOTFS was not found."
311
+    echo $"The rootfs partition $MICROSD_MOUNT_POINT/$ROOTFS was not found."
312
     ls $MICROSD_MOUNT_POINT
312
     ls $MICROSD_MOUNT_POINT
313
     exit 65688
313
     exit 65688
314
 fi
314
 fi
315
 
315
 
316
 if [ ! -d $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/home ]; then
316
 if [ ! -d $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/home ]; then
317
     echo ''
317
     echo ''
318
-    echo "The rootfs partition was not written correctly."
318
+    echo $"The rootfs partition was not written correctly."
319
     ls $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR
319
     ls $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR
320
     exit 65688
320
     exit 65688
321
 fi
321
 fi
328
 $SUDO cp -f $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/usr/local/bin/freedombone-mesh $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/usr/local/bin/mesh
328
 $SUDO cp -f $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/usr/local/bin/freedombone-mesh $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/usr/local/bin/mesh
329
 $SUDO cp -f $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/usr/local/bin/freedombone-meshweb $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/usr/local/bin/meshweb
329
 $SUDO cp -f $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/usr/local/bin/freedombone-meshweb $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/usr/local/bin/meshweb
330
 if [ ! -f $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/usr/local/bin/freedombone ]; then
330
 if [ ! -f $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/usr/local/bin/freedombone ]; then
331
-    echo 'There was a problem with writing freedombone commands to the SD card'
331
+    echo $'There was a problem with writing freedombone commands to the SD card'
332
     exit 8736
332
     exit 8736
333
 fi
333
 fi
334
 
334
 
339
 
339
 
340
 # change the motd to show further install instructions
340
 # change the motd to show further install instructions
341
 echo '' >> /tmp/freedombone_motd
341
 echo '' >> /tmp/freedombone_motd
342
-echo 'Create a user for the system with:' >> /tmp/freedombone_motd
342
+echo $'Create a user for the system with:' >> /tmp/freedombone_motd
343
 echo '' >> /tmp/freedombone_motd
343
 echo '' >> /tmp/freedombone_motd
344
 echo '    adduser [username]' >> /tmp/freedombone_motd
344
 echo '    adduser [username]' >> /tmp/freedombone_motd
345
 echo '' >> /tmp/freedombone_motd
345
 echo '' >> /tmp/freedombone_motd
346
-echo 'Enter the command "exit" a couple of times to get back to your main system' >> /tmp/freedombone_motd
347
-echo 'then log back in as the user you just created with:' >> /tmp/freedombone_motd
346
+echo $'Enter the command "exit" a couple of times to get back to your main system' >> /tmp/freedombone_motd
347
+echo $'then log back in as the user you just created with:' >> /tmp/freedombone_motd
348
 echo '' >> /tmp/freedombone_motd
348
 echo '' >> /tmp/freedombone_motd
349
 echo "    ssh [username]@$BOX_IP_ADDRESS" >> /tmp/freedombone_motd
349
 echo "    ssh [username]@$BOX_IP_ADDRESS" >> /tmp/freedombone_motd
350
 echo '' >> /tmp/freedombone_motd
350
 echo '' >> /tmp/freedombone_motd
351
-echo 'and use the "su" command to become the root user again.' >> /tmp/freedombone_motd
351
+echo $'and use the "su" command to become the root user again.' >> /tmp/freedombone_motd
352
 echo '' >> /tmp/freedombone_motd
352
 echo '' >> /tmp/freedombone_motd
353
-echo 'Finally you can use the freedombone command to install a server configuration:' >> /tmp/freedombone_motd
353
+echo $'Finally you can use the freedombone command to install a server configuration:' >> /tmp/freedombone_motd
354
 echo '' >> /tmp/freedombone_motd
354
 echo '' >> /tmp/freedombone_motd
355
 echo '    apt-get update' >> /tmp/freedombone_motd
355
 echo '    apt-get update' >> /tmp/freedombone_motd
356
 echo '    apt-get -y install git dialog build-essential' >> /tmp/freedombone_motd
356
 echo '    apt-get -y install git dialog build-essential' >> /tmp/freedombone_motd
359
 $SUDO cp -f /tmp/freedombone_motd $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/etc/motd
359
 $SUDO cp -f /tmp/freedombone_motd $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/etc/motd
360
 
360
 
361
 clear
361
 clear
362
-echo '*** Initial microSD card setup is complete ***'
362
+echo $'*** Initial microSD card setup is complete ***'
363
 echo ''
363
 echo ''
364
-echo 'To avoid running out of disk space you may first wish to resize the'
365
-echo 'partition to the size of your microSD card, using something like gparted.'
364
+echo $'To avoid running out of disk space you may first wish to resize the'
365
+echo $'partition to the size of your microSD card, using something like gparted.'
366
 echo ''
366
 echo ''
367
-echo 'The microSD card can now be removed and inserted into the Beaglebone Black.'
368
-echo 'Once the Beaglebone has booted then you can log in with:'
367
+echo $'The microSD card can now be removed and inserted into the Beaglebone Black.'
368
+echo $'Once the Beaglebone has booted then you can log in with:'
369
 echo ''
369
 echo ''
370
 echo "    ssh root@$BOX_IP_ADDRESS"
370
 echo "    ssh root@$BOX_IP_ADDRESS"
371
 echo ''
371
 echo ''
372
-echo 'The root password should be changed with the command "passwd".'
372
+echo $'The root password should be changed with the command "passwd".'
373
 cat /tmp/freedombone_motd
373
 cat /tmp/freedombone_motd
374
 rm /tmp/freedombone_motd
374
 rm /tmp/freedombone_motd
375
 $SUDO umount $MICROSD_MOUNT_POINT/$ROOTFS
375
 $SUDO umount $MICROSD_MOUNT_POINT/$ROOTFS

+ 15
- 15
src/freedombone-recoverkey Näytä tiedosto

39
 
39
 
40
 function show_help {
40
 function show_help {
41
     echo ''
41
     echo ''
42
-    echo 'freedombone-recoverkey -u [username] -d [drive]'
43
-    echo '                       -l [friends servers list filename]'
42
+    echo $'freedombone-recoverkey -u [username] -d [drive]'
43
+    echo $'                       -l [friends servers list filename]'
44
     echo ''
44
     echo ''
45
     exit 0
45
     exit 0
46
 }
46
 }
78
     show_help
78
     show_help
79
 fi
79
 fi
80
 if [ ! -d /home/$MY_USERNAME ]; then
80
 if [ ! -d /home/$MY_USERNAME ]; then
81
-    echo "User $MY_USERNAME does not exist on the system"
81
+    echo $"User $MY_USERNAME does not exist on the system"
82
     exit 7270
82
     exit 7270
83
 fi
83
 fi
84
 
84
 
85
 if [ ! $MY_USERNAME ]; then
85
 if [ ! $MY_USERNAME ]; then
86
-    echo 'No username given'
86
+    echo $'No username given'
87
     exit 3578
87
     exit 3578
88
 fi
88
 fi
89
 if [ ! -d /home/$MY_USERNAME ]; then
89
 if [ ! -d /home/$MY_USERNAME ]; then
90
-    echo "User $MY_USERNAME does not exist on the system"
90
+    echo $"User $MY_USERNAME does not exist on the system"
91
     exit 7270
91
     exit 7270
92
 fi
92
 fi
93
 
93
 
117
 
117
 
118
     su -c "gpg --allow-secret-key-import --import $KEYS_FILE" - $MY_USERNAME
118
     su -c "gpg --allow-secret-key-import --import $KEYS_FILE" - $MY_USERNAME
119
     if [ ! "$?" = "0" ]; then
119
     if [ ! "$?" = "0" ]; then
120
-        echo 'Unable to import gpg key'
120
+        echo $'Unable to import gpg key'
121
         shred -zu $KEYS_FILE
121
         shred -zu $KEYS_FILE
122
         rm -rf /home/$MY_USERNAME/.tempgnupg
122
         rm -rf /home/$MY_USERNAME/.tempgnupg
123
         exit 9654
123
         exit 9654
256
                 mkdir -p /home/$MY_USERNAME/.gnupg_fragments
256
                 mkdir -p /home/$MY_USERNAME/.gnupg_fragments
257
             fi
257
             fi
258
 
258
 
259
-            echo -n "Starting key retrieval from $REMOTE_SERVER..."
259
+            echo -n $"Starting key retrieval from $REMOTE_SERVER..."
260
             /usr/bin/sshpass -p $REMOTE_PASSWORD \
260
             /usr/bin/sshpass -p $REMOTE_PASSWORD \
261
                              scp -r -P $REMOTE_SSH_PORT $REMOTE_SERVER/.gnupg_fragments/* /home/$MY_USERNAME/.gnupg_fragments
261
                              scp -r -P $REMOTE_SSH_PORT $REMOTE_SERVER/.gnupg_fragments/* /home/$MY_USERNAME/.gnupg_fragments
262
             if [ ! "$?" = "0" ]; then
262
             if [ ! "$?" = "0" ]; then
263
-                echo 'FAILED'
263
+                echo $'FAILED'
264
             else
264
             else
265
-                echo 'Ok'
265
+                echo $'Ok'
266
             fi
266
             fi
267
         fi
267
         fi
268
     done < $FRIENDS_SERVERS_LIST
268
     done < $FRIENDS_SERVERS_LIST
270
 
270
 
271
 # was a directory created?
271
 # was a directory created?
272
 if [ ! -d $FRAGMENTS_DIR ]; then
272
 if [ ! -d $FRAGMENTS_DIR ]; then
273
-    echo 'No fragments have been recovered, so the key cannot be recovered'
273
+    echo $'No fragments have been recovered, so the key cannot be recovered'
274
     exit 7483
274
     exit 7483
275
 fi
275
 fi
276
 
276
 
278
 cd $FRAGMENTS_DIR
278
 cd $FRAGMENTS_DIR
279
 no_of_shares=$(ls -afq keyshare.asc.* | wc -l)
279
 no_of_shares=$(ls -afq keyshare.asc.* | wc -l)
280
 if (( no_of_shares == 0 )); then
280
 if (( no_of_shares == 0 )); then
281
-    echo 'No key fragments were retrieved'
281
+    echo $'No key fragments were retrieved'
282
     exit 76882
282
     exit 76882
283
 fi
283
 fi
284
 
284
 
291
 gfcombine $KEYS_FILE.*
291
 gfcombine $KEYS_FILE.*
292
 
292
 
293
 if [ ! -f $KEYS_FILE ]; then
293
 if [ ! -f $KEYS_FILE ]; then
294
-    echo 'Unable to decrypt key. This may mean that not enough fragments are available'
294
+    echo $'Unable to decrypt key. This may mean that not enough fragments are available'
295
     exit 6283
295
     exit 6283
296
 fi
296
 fi
297
 
297
 
298
-echo 'Key fragments recombined'
298
+echo $'Key fragments recombined'
299
 
299
 
300
 # import the gpg key
300
 # import the gpg key
301
 su -c "gpg --allow-secret-key-import --import $KEYS_FILE" - $MY_USERNAME
301
 su -c "gpg --allow-secret-key-import --import $KEYS_FILE" - $MY_USERNAME
302
 if [ ! "$?" = "0" ]; then
302
 if [ ! "$?" = "0" ]; then
303
-    echo 'Unable to import gpg key'
303
+    echo $'Unable to import gpg key'
304
     shred -zu $KEYS_FILE
304
     shred -zu $KEYS_FILE
305
     exit 3682
305
     exit 3682
306
 fi
306
 fi
308
 chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.gnupg
308
 chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.gnupg
309
 chmod -R 600 /home/$MY_USERNAME/.gnupg
309
 chmod -R 600 /home/$MY_USERNAME/.gnupg
310
 
310
 
311
-echo 'GPG key was recovered'
311
+echo $'GPG key was recovered'
312
 
312
 
313
 exit 0
313
 exit 0

+ 14
- 14
src/freedombone-remote Näytä tiedosto

57
 
57
 
58
 function show_help {
58
 function show_help {
59
   echo ''
59
   echo ''
60
-  echo 'freedombone-remote -u [username] -l [backup list filename] -m [min password length]'
60
+  echo $'freedombone-remote -u [username] -l [backup list filename] -m [min password length]'
61
   echo ''
61
   echo ''
62
-  echo 'Creates an inventory of remote backup locations'
62
+  echo $'Creates an inventory of remote backup locations'
63
   echo ''
63
   echo ''
64
   echo ''
64
   echo ''
65
-  echo '  -h --help             Show help'
66
-  echo '  -u --username         User to create the backups.list file for'
67
-  echo '  -l --list             Remote backup list (usually /home/$USER/backup.list)'
68
-  echo '  -m --min              Minimum password length (characters)'
69
-  echo '  -r --reciprocal       Whether to add reciprocal user accounts'
70
-  echo '  -t --title            Title shown'
65
+  echo $'  -h --help             Show help'
66
+  echo $'  -u --username         User to create the backups.list file for'
67
+  echo $'  -l --list             Remote backup list (usually /home/$USER/backup.list)'
68
+  echo $'  -m --min              Minimum password length (characters)'
69
+  echo $'  -r --reciprocal       Whether to add reciprocal user accounts'
70
+  echo $'  -t --title            Title shown'
71
   echo ''
71
   echo ''
72
   exit 0
72
   exit 0
73
 }
73
 }
117
 
117
 
118
 function interactive_configuration_remote_backups {
118
 function interactive_configuration_remote_backups {
119
   if [ ! $MY_USERNAME ]; then
119
   if [ ! $MY_USERNAME ]; then
120
-      echo 'Please specify a username with the -u option'
120
+      echo $'Please specify a username with the -u option'
121
       exit 7356
121
       exit 7356
122
   fi
122
   fi
123
 
123
 
124
   if [ ! /home/$MY_USERNAME ]; then
124
   if [ ! /home/$MY_USERNAME ]; then
125
-      echo "The user /home/$MY_USERNAME does not exist on the system"
125
+      echo $"The user /home/$MY_USERNAME does not exist on the system"
126
       exit 3689
126
       exit 3689
127
   fi
127
   fi
128
 
128
 
238
 function show_result {
238
 function show_result {
239
   clear
239
   clear
240
   if (( $entering_remote_backups_ctr < 2 )); then
240
   if (( $entering_remote_backups_ctr < 2 )); then
241
-      echo 'No remote backup locations were specified'
241
+      echo $'No remote backup locations were specified'
242
       exit 0
242
       exit 0
243
   fi
243
   fi
244
   if [ ! -f $FRIENDS_SERVERS_LIST ]; then
244
   if [ ! -f $FRIENDS_SERVERS_LIST ]; then
245
-      echo "No remote backups list found: $FRIENDS_SERVERS_LIST"
245
+      echo $"No remote backups list found: $FRIENDS_SERVERS_LIST"
246
       exit 7358
246
       exit 7358
247
   fi
247
   fi
248
   echo ''
248
   echo ''
249
-  echo "Remote backups list: $FRIENDS_SERVERS_LIST"
249
+  echo $"Remote backups list: $FRIENDS_SERVERS_LIST"
250
   echo ''
250
   echo ''
251
-  echo 'Contents:'
251
+  echo $'Contents:'
252
   echo ''
252
   echo ''
253
   cat $FRIENDS_SERVERS_LIST
253
   cat $FRIENDS_SERVERS_LIST
254
   echo ''
254
   echo ''

+ 26
- 26
src/freedombone-renew-cert Näytä tiedosto

40
 
40
 
41
 function show_help {
41
 function show_help {
42
     echo ''
42
     echo ''
43
-    echo 'freedombone-renew-cert -h [hostname] -p [provider]'
43
+    echo $'freedombone-renew-cert -h [hostname] -p [provider]'
44
     echo ''
44
     echo ''
45
-    echo 'Makes it easier to renew a ssl/tls certificate for a website'
45
+    echo $'Makes it easier to renew a ssl/tls certificate for a website'
46
     echo ''
46
     echo ''
47
-    echo '     --help                  Show help'
48
-    echo '  -h --hostname [name]       Hostname'
49
-    echo '  -p --provider [name]       eg. startssl/letsencrypt'
47
+    echo $'     --help                  Show help'
48
+    echo $'  -h --hostname [name]       Hostname'
49
+    echo $'  -p --provider [name]       eg. startssl/letsencrypt'
50
     echo ''
50
     echo ''
51
     exit 0
51
     exit 0
52
 }
52
 }
53
 
53
 
54
 function renew_letsencrypt {
54
 function renew_letsencrypt {
55
     if [ ! -f /etc/letsencrypt/live/${HOSTNAME}/fullchain.pem ]; then
55
     if [ ! -f /etc/letsencrypt/live/${HOSTNAME}/fullchain.pem ]; then
56
-        echo "Adding Let's Encrypt certificate"
56
+        echo $"Adding Let's Encrypt certificate"
57
         freedombone-addcert -e $HOSTNAME -s $LETSENCRYPT_SERVER --dhkey $DH_KEYLENGTH
57
         freedombone-addcert -e $HOSTNAME -s $LETSENCRYPT_SERVER --dhkey $DH_KEYLENGTH
58
         if [ ! "$?" = "0" ]; then
58
         if [ ! "$?" = "0" ]; then
59
-            echo "Unable to add Let's encrypt certificate"
59
+            echo $"Unable to add Let's encrypt certificate"
60
             exit 6328
60
             exit 6328
61
         fi
61
         fi
62
     else
62
     else
63
-        echo "Renewing Let's Encrypt certificate"
63
+        echo $"Renewing Let's Encrypt certificate"
64
         letsencrypt renew \
64
         letsencrypt renew \
65
                     --cert-path /etc/letsencrypt/live/${HOSTNAME}/fullchain.pem \
65
                     --cert-path /etc/letsencrypt/live/${HOSTNAME}/fullchain.pem \
66
                     --key-path /etc/letsencrypt/live/${HOSTNAME}/privkey.pem
66
                     --key-path /etc/letsencrypt/live/${HOSTNAME}/privkey.pem
67
         if [ ! "$?" = "0" ]; then
67
         if [ ! "$?" = "0" ]; then
68
-            echo "Unable to renew Let's encrypt certificate"
68
+            echo $"Unable to renew Let's encrypt certificate"
69
             exit 2624
69
             exit 2624
70
         fi
70
         fi
71
     fi
71
     fi
76
 }
76
 }
77
 
77
 
78
 function renew_startssl {
78
 function renew_startssl {
79
-    echo 'Renewing StartSSL certificate'
79
+    echo $'Renewing StartSSL certificate'
80
     if [ -s /etc/ssl/certs/$HOSTNAME.new.crt ]; then
80
     if [ -s /etc/ssl/certs/$HOSTNAME.new.crt ]; then
81
         if ! grep -q "-BEGIN CERTIFICATE-" /etc/ssl/certs/$HOSTNAME.new.crt; then
81
         if ! grep -q "-BEGIN CERTIFICATE-" /etc/ssl/certs/$HOSTNAME.new.crt; then
82
-            echo '/etc/ssl/certs/$HOSTNAME.new.crt does not contain a public key'
82
+            echo $'/etc/ssl/certs/$HOSTNAME.new.crt does not contain a public key'
83
             return
83
             return
84
         fi
84
         fi
85
 
85
 
137
         # update your site to include the bundle
137
         # update your site to include the bundle
138
         sed -i "s|$HOSTNAME.crt|$HOSTNAME.bundle.crt|g" /etc/nginx/sites-available/$HOSTNAME
138
         sed -i "s|$HOSTNAME.crt|$HOSTNAME.bundle.crt|g" /etc/nginx/sites-available/$HOSTNAME
139
 
139
 
140
-        echo 'Certificate installed'
140
+        echo $'Certificate installed'
141
         service nginx restart
141
         service nginx restart
142
         return
142
         return
143
     fi
143
     fi
144
 
144
 
145
     if [ -f /etc/ssl/requests/$HOSTNAME.csr ]; then
145
     if [ -f /etc/ssl/requests/$HOSTNAME.csr ]; then
146
-        echo 'Certificate request already created:'
146
+        echo $'Certificate request already created:'
147
         echo ''
147
         echo ''
148
         cat /etc/ssl/requests/$HOSTNAME.csr
148
         cat /etc/ssl/requests/$HOSTNAME.csr
149
         echo ''
149
         echo ''
150
-        echo "Save the requested public key to /etc/ssl/certs/$HOSTNAME.new.crt"
151
-        echo 'then run this command again.'
150
+        echo $"Save the requested public key to /etc/ssl/certs/$HOSTNAME.new.crt"
151
+        echo $'then run this command again.'
152
         echo ''
152
         echo ''
153
         return
153
         return
154
     fi
154
     fi
162
     echo ''
162
     echo ''
163
     cat /etc/ssl/requests/$HOSTNAME.csr
163
     cat /etc/ssl/requests/$HOSTNAME.csr
164
     echo ''
164
     echo ''
165
-    echo 'On the StartSSL site select Certificates Wizard then'
166
-    echo 'Web server SSL/TLS Certificate. You can then click on "skip"'
167
-    echo 'and then copy and paste the above certificate request into the text'
168
-    echo 'entry box. You may now need to wait a few hours for a confirmation'
169
-    echo 'email indicating that the new certificate was created.'
165
+    echo $'On the StartSSL site select Certificates Wizard then'
166
+    echo $'Web server SSL/TLS Certificate. You can then click on "skip"'
167
+    echo $'and then copy and paste the above certificate request into the text'
168
+    echo $'entry box. You may now need to wait a few hours for a confirmation'
169
+    echo $'email indicating that the new certificate was created.'
170
     echo ''
170
     echo ''
171
-    echo 'Once you have retrieved the new public certificate paste it to:'
172
-    echo "/etc/ssl/certs/$HOSTNAME.new.crt then run this command again."
171
+    echo $'Once you have retrieved the new public certificate paste it to:'
172
+    echo $"/etc/ssl/certs/$HOSTNAME.new.crt then run this command again."
173
     echo ''
173
     echo ''
174
 }
174
 }
175
 
175
 
197
 done
197
 done
198
 
198
 
199
 if [ ! $HOSTNAME ]; then
199
 if [ ! $HOSTNAME ]; then
200
-    echo 'No hostname specified'
200
+    echo $'No hostname specified'
201
     exit 5748
201
     exit 5748
202
 fi
202
 fi
203
 
203
 
204
 if ! which openssl > /dev/null ;then
204
 if ! which openssl > /dev/null ;then
205
-    echo "$0: openssl is not installed, exiting" 1>&2
205
+    echo $"$0: openssl is not installed, exiting" 1>&2
206
     exit 5689
206
     exit 5689
207
 fi
207
 fi
208
 
208
 
209
 # check that the web site exists
209
 # check that the web site exists
210
 if [ ! -f /etc/nginx/sites-available/$HOSTNAME ]; then
210
 if [ ! -f /etc/nginx/sites-available/$HOSTNAME ]; then
211
-    echo "/etc/nginx/sites-available/$HOSTNAME does not exist"
211
+    echo $"/etc/nginx/sites-available/$HOSTNAME does not exist"
212
     exit 7598
212
     exit 7598
213
 fi
213
 fi
214
 
214
 
218
     if [[ $PROVIDER == 'letsencrypt' ]]; then
218
     if [[ $PROVIDER == 'letsencrypt' ]]; then
219
         renew_letsencrypt
219
         renew_letsencrypt
220
     else
220
     else
221
-        echo "$PROVIDER is not currently supported"
221
+        echo $"$PROVIDER is not currently supported"
222
     fi
222
     fi
223
 fi
223
 fi
224
 
224
 

+ 1
- 1
src/freedombone-rmemail Näytä tiedosto

38
 
38
 
39
 function show_help {
39
 function show_help {
40
     echo ''
40
     echo ''
41
-    echo 'freedombone-rmemail -u [username] -e [email address]'
41
+    echo $'freedombone-rmemail -u [username] -e [email address]'
42
     echo ''
42
     echo ''
43
     exit 0
43
     exit 0
44
 }
44
 }

+ 1
- 1
src/freedombone-rmlist Näytä tiedosto

40
 
40
 
41
 function show_help {
41
 function show_help {
42
     echo ''
42
     echo ''
43
-    echo 'freedombone-rmlist -u [username] -l [mailing list name] -e [list email address]'
43
+    echo $'freedombone-rmlist -u [username] -l [mailing list name] -e [list email address]'
44
     echo ''
44
     echo ''
45
     exit 0
45
     exit 0
46
 }
46
 }

+ 5
- 5
src/freedombone-rmsipuser Näytä tiedosto

40
 
40
 
41
 function show_help {
41
 function show_help {
42
     echo ''
42
     echo ''
43
-    echo 'freedombone-rmsipuser [username]'
43
+    echo $'freedombone-rmsipuser [username]'
44
     echo ''
44
     echo ''
45
     exit 0
45
     exit 0
46
 }
46
 }
85
 fi
85
 fi
86
 
86
 
87
 if [ ! -f $CONFIG_FILE ]; then
87
 if [ ! -f $CONFIG_FILE ]; then
88
-    echo "SIP configuration file not found"
88
+    echo $"SIP configuration file not found"
89
     exit 1
89
     exit 1
90
 fi
90
 fi
91
 
91
 
92
 # the user must already exist on the system
92
 # the user must already exist on the system
93
 if [ ! -d /home/$MY_USERNAME ]; then
93
 if [ ! -d /home/$MY_USERNAME ]; then
94
-    echo "User $MY_USERNAME not found"
94
+    echo $"User $MY_USERNAME not found"
95
     exit 2
95
     exit 2
96
 fi
96
 fi
97
 
97
 
98
 sip_user_exists
98
 sip_user_exists
99
 
99
 
100
 if [[ $USER_EXISTS != "yes" ]]; then
100
 if [[ $USER_EXISTS != "yes" ]]; then
101
-    echo 'User not found within SIP configuration file'
101
+    echo $'User not found within SIP configuration file'
102
     exit 3
102
     exit 3
103
 fi
103
 fi
104
 
104
 
108
 
108
 
109
 systemctl start sipwitch
109
 systemctl start sipwitch
110
 
110
 
111
-echo "SIP user $MY_USERNAME removed"
111
+echo $"SIP user $MY_USERNAME removed"
112
 exit 0
112
 exit 0

+ 10
- 10
src/freedombone-rmuser Näytä tiedosto

9
 COMPLETION_FILE=$HOME/freedombone-completed.txt
9
 COMPLETION_FILE=$HOME/freedombone-completed.txt
10
 
10
 
11
 if [ ! $MY_USERNAME ]; then
11
 if [ ! $MY_USERNAME ]; then
12
-    echo 'Please specify a username to remove'
12
+    echo $'Please specify a username to remove'
13
     exit 1
13
     exit 1
14
 fi
14
 fi
15
 
15
 
16
 if [ ! -d /home/$MY_USERNAME ]; then
16
 if [ ! -d /home/$MY_USERNAME ]; then
17
-    echo "Home directory does not exist for $MY_USERNAME"
17
+    echo $"Home directory does not exist for $MY_USERNAME"
18
     exit 2
18
     exit 2
19
 fi
19
 fi
20
 
20
 
21
 if [ ! -f $COMPLETION_FILE ]; then
21
 if [ ! -f $COMPLETION_FILE ]; then
22
-    echo "$COMPLETION_FILE not found"
22
+    echo $"$COMPLETION_FILE not found"
23
     exit 3
23
     exit 3
24
 fi
24
 fi
25
 
25
 
26
 if ! grep -q "Admin user" $COMPLETION_FILE; then
26
 if ! grep -q "Admin user" $COMPLETION_FILE; then
27
-    echo "No admin user specified in $COMPLETION_FILE"
27
+    echo $"No admin user specified in $COMPLETION_FILE"
28
     exit 4
28
     exit 4
29
 fi
29
 fi
30
 
30
 
31
 ADMIN_USERNAME=$(cat $COMPLETION_FILE | grep "Admin user" | awk -F ':' '{print $2}')
31
 ADMIN_USERNAME=$(cat $COMPLETION_FILE | grep "Admin user" | awk -F ':' '{print $2}')
32
 if [ ! $ADMIN_USERNAME ]; then
32
 if [ ! $ADMIN_USERNAME ]; then
33
-    echo "No admin username specified in $COMPLETION_FILE"
33
+    echo $"No admin username specified in $COMPLETION_FILE"
34
     exit 5
34
     exit 5
35
 fi
35
 fi
36
 
36
 
37
 if [[ $MY_USERNAME == $ADMIN_USERNAME ]]; then
37
 if [[ $MY_USERNAME == $ADMIN_USERNAME ]]; then
38
-    echo "The administrator user cannot be removed"
38
+    echo $"The administrator user cannot be removed"
39
     exit 6
39
     exit 6
40
 fi
40
 fi
41
 
41
 
42
-echo '>>> REMOVE USER <<<'
43
-read -p "Do you really wish to remove the user '$MY_USERNAME' (y/n) ?" yn
42
+echo $'>>> REMOVE USER <<<'
43
+read -p $"Do you really wish to remove the user '$MY_USERNAME' (y/n) ?" yn
44
 if [[ $yn != 'y' && $yn != 'Y' && $yn != 'yes' && $yn != 'Yes' && $yn != 'YES' ]]; then
44
 if [[ $yn != 'y' && $yn != 'Y' && $yn != 'yes' && $yn != 'Yes' && $yn != 'YES' ]]; then
45
-    echo "User $MY_USERNAME was not removed"
45
+    echo $"User $MY_USERNAME was not removed"
46
     exit 7
46
     exit 7
47
 fi
47
 fi
48
 
48
 
71
     rm -rf /home/$MY_USERNAME
71
     rm -rf /home/$MY_USERNAME
72
 fi
72
 fi
73
 
73
 
74
-echo "User $MY_USERNAME was removed"
74
+echo $"User $MY_USERNAME was removed"
75
 
75
 
76
 exit 0
76
 exit 0

+ 1
- 1
src/freedombone-rmxmpp Näytä tiedosto

38
 
38
 
39
 function show_help {
39
 function show_help {
40
     echo ''
40
     echo ''
41
-    echo 'freedombone-rmxmpp -e [email address]'
41
+    echo $'freedombone-rmxmpp -e [email address]'
42
     echo ''
42
     echo ''
43
     exit 0
43
     exit 0
44
 }
44
 }

+ 18
- 18
src/freedombone-sec Näytä tiedosto

156
       sed -i "s|ssl_ciphers .*|ssl_ciphers '$SSL_CIPHERS';|g" $WEBSITES_DIRECTORY/$file
156
       sed -i "s|ssl_ciphers .*|ssl_ciphers '$SSL_CIPHERS';|g" $WEBSITES_DIRECTORY/$file
157
   done
157
   done
158
   service nginx restart
158
   service nginx restart
159
-  echo 'Web security settings changed'
159
+  echo $'Web security settings changed'
160
 }
160
 }
161
 
161
 
162
 function change_imap_settings {
162
 function change_imap_settings {
172
   sed -i "s|ssl_cipher_list.*|ssl_cipher_list = '$SSL_CIPHERS'|g" $DOVECOT_CIPHERS
172
   sed -i "s|ssl_cipher_list.*|ssl_cipher_list = '$SSL_CIPHERS'|g" $DOVECOT_CIPHERS
173
   sed -i "s|ssl_protocols.*|ssl_protocols = '$SSL_PROTOCOLS'|g" $DOVECOT_CIPHERS
173
   sed -i "s|ssl_protocols.*|ssl_protocols = '$SSL_PROTOCOLS'|g" $DOVECOT_CIPHERS
174
   service dovecot restart
174
   service dovecot restart
175
-  echo 'imap security settings changed'
175
+  echo $'imap security settings changed'
176
 }
176
 }
177
 
177
 
178
 function change_ssh_settings {
178
 function change_ssh_settings {
179
   if [ -f /etc/ssh/ssh_config ]; then
179
   if [ -f /etc/ssh/ssh_config ]; then
180
       if [ $SSH_HOST_KEY_ALGORITHMS ]; then
180
       if [ $SSH_HOST_KEY_ALGORITHMS ]; then
181
           sed -i "s|HostKeyAlgorithms .*|HostKeyAlgorithms $SSH_HOST_KEY_ALGORITHMS|g" /etc/ssh/ssh_config
181
           sed -i "s|HostKeyAlgorithms .*|HostKeyAlgorithms $SSH_HOST_KEY_ALGORITHMS|g" /etc/ssh/ssh_config
182
-          echo 'ssh client security settings changed'
182
+          echo $'ssh client security settings changed'
183
       fi
183
       fi
184
   fi
184
   fi
185
   if [ -f $SSH_CONFIG ]; then
185
   if [ -f $SSH_CONFIG ]; then
201
       sed -i "s|KexAlgorithms .*|KexAlgorithms $SSH_KEX|g" $SSH_CONFIG
201
       sed -i "s|KexAlgorithms .*|KexAlgorithms $SSH_KEX|g" $SSH_CONFIG
202
       sed -i "s|PasswordAuthentication .*|PasswordAuthentication $SSH_PASSWORDS|g" $SSH_CONFIG
202
       sed -i "s|PasswordAuthentication .*|PasswordAuthentication $SSH_PASSWORDS|g" $SSH_CONFIG
203
       service ssh restart
203
       service ssh restart
204
-      echo 'ssh server security settings changed'
204
+      echo $'ssh server security settings changed'
205
   fi
205
   fi
206
 }
206
 }
207
 
207
 
218
   sed -i "s|ciphers =.*|ciphers = \"$XMPP_CIPHERS\";|g" $XMPP_CONFIG
218
   sed -i "s|ciphers =.*|ciphers = \"$XMPP_CIPHERS\";|g" $XMPP_CONFIG
219
   sed -i "s|curve =.*|curve = \"$XMPP_ECC_CURVE\";|g" $XMPP_CONFIG
219
   sed -i "s|curve =.*|curve = \"$XMPP_ECC_CURVE\";|g" $XMPP_CONFIG
220
   service prosody restart
220
   service prosody restart
221
-  echo 'xmpp security settings changed'
221
+  echo $'xmpp security settings changed'
222
 }
222
 }
223
 
223
 
224
 function interactive_setup {
224
 function interactive_setup {
316
   sel=$?
316
   sel=$?
317
   case $sel in
317
   case $sel in
318
       1) clear
318
       1) clear
319
-         echo 'Exiting without changing security settings'
319
+         echo $'Exiting without changing security settings'
320
          exit 0;;
320
          exit 0;;
321
       255) clear
321
       255) clear
322
-           echo 'Exiting without changing security settings'
322
+           echo $'Exiting without changing security settings'
323
            exit 0;;
323
            exit 0;;
324
   esac
324
   esac
325
 
325
 
330
   if [[ $REGENERATE_SSH_HOST_KEYS == "yes" ]]; then
330
   if [[ $REGENERATE_SSH_HOST_KEYS == "yes" ]]; then
331
       rm -f /etc/ssh/ssh_host_*
331
       rm -f /etc/ssh/ssh_host_*
332
       dpkg-reconfigure openssh-server
332
       dpkg-reconfigure openssh-server
333
-      echo 'ssh host keys regenerated'
333
+      echo $'ssh host keys regenerated'
334
       # remove small moduli
334
       # remove small moduli
335
       awk '$5 > 2000' /etc/ssh/moduli > ~/moduli
335
       awk '$5 > 2000' /etc/ssh/moduli > ~/moduli
336
       mv ~/moduli /etc/ssh/moduli
336
       mv ~/moduli /etc/ssh/moduli
337
-      echo 'ssh small moduli removed'
337
+      echo $'ssh small moduli removed'
338
       systemctl restart ssh
338
       systemctl restart ssh
339
   fi
339
   fi
340
 }
340
 }
342
 function regenerate_dh_keys {
342
 function regenerate_dh_keys {
343
   if [[ $REGENERATE_DH_KEYS == "yes" ]]; then
343
   if [[ $REGENERATE_DH_KEYS == "yes" ]]; then
344
       if [ ! -d /etc/ssl/mycerts ]; then
344
       if [ ! -d /etc/ssl/mycerts ]; then
345
-          echo 'No dhparam certificates were found'
345
+          echo $'No dhparam certificates were found'
346
           return
346
           return
347
       fi
347
       fi
348
 
348
 
376
               fi
376
               fi
377
           fi
377
           fi
378
       done
378
       done
379
-      echo "$ctr dhparam certificates were regenerated"
379
+      echo $"$ctr dhparam certificates were regenerated"
380
   fi
380
   fi
381
 }
381
 }
382
 
382
 
500
   fi
500
   fi
501
 
501
 
502
   if [ ! -f $IMPORT_FILE ]; then
502
   if [ ! -f $IMPORT_FILE ]; then
503
-      echo "Import file $IMPORT_FILE not found"
503
+      echo $"Import file $IMPORT_FILE not found"
504
       exit 6393
504
       exit 6393
505
   fi
505
   fi
506
 
506
 
662
           echo "XMPP_ECC_CURVE=$XMPP_ECC_CURVE" >> $EXPORT_FILE
662
           echo "XMPP_ECC_CURVE=$XMPP_ECC_CURVE" >> $EXPORT_FILE
663
       fi
663
       fi
664
   fi
664
   fi
665
-  echo "Security settings exported to $EXPORT_FILE"
665
+  echo $"Security settings exported to $EXPORT_FILE"
666
   exit 0
666
   exit 0
667
 }
667
 }
668
 
668
 
669
 function show_help {
669
 function show_help {
670
   echo ''
670
   echo ''
671
-  echo 'freedombone-sec'
671
+  echo "${PROJECT_NAME}-sec"
672
   echo ''
672
   echo ''
673
-  echo 'Alters the security settings'
673
+  echo $'Alters the security settings'
674
   echo ''
674
   echo ''
675
   echo ''
675
   echo ''
676
-  echo '  -h --help             Show help'
677
-  echo '  -e --export           Export security settings to a file'
678
-  echo '  -i --import           Import security settings from a file'
676
+  echo $'  -h --help             Show help'
677
+  echo $'  -e --export           Export security settings to a file'
678
+  echo $'  -i --import           Import security settings from a file'
679
   echo ''
679
   echo ''
680
   exit 0
680
   exit 0
681
 }
681
 }

+ 11
- 11
src/freedombone-splitkey Näytä tiedosto

46
 
46
 
47
 function show_help {
47
 function show_help {
48
     echo ''
48
     echo ''
49
-    echo 'freedombone-splitkey -u [username] -n [number of fragments] -e [email address] --fullname [Full name]'
49
+    echo $'freedombone-splitkey -u [username] -n [number of fragments] -e [email address] --fullname [Full name]'
50
     echo ''
50
     echo ''
51
     exit 0
51
     exit 0
52
 }
52
 }
86
     show_help
86
     show_help
87
 fi
87
 fi
88
 if [ ! -d /home/$MY_USERNAME ]; then
88
 if [ ! -d /home/$MY_USERNAME ]; then
89
-    echo "User $MY_USERNAME does not exist on the system"
89
+    echo $"User $MY_USERNAME does not exist on the system"
90
     exit 7270
90
     exit 7270
91
 fi
91
 fi
92
 
92
 
93
 if [ ! -d /home/$MY_USERNAME/.gnupg ]; then
93
 if [ ! -d /home/$MY_USERNAME/.gnupg ]; then
94
-    echo 'No gpg key found'
94
+    echo $'No gpg key found'
95
     exit 5393
95
     exit 5393
96
 fi
96
 fi
97
 
97
 
107
 KEYID=$(su -c "gpg --list-keys $MY_EMAIL_ADDRESS | grep 'pub '" - \
107
 KEYID=$(su -c "gpg --list-keys $MY_EMAIL_ADDRESS | grep 'pub '" - \
108
            $MY_USERNAME | awk -F ' ' '{print $2}' | awk -F '/' '{print $2}')
108
            $MY_USERNAME | awk -F ' ' '{print $2}' | awk -F '/' '{print $2}')
109
 if [ ${#KEYID} -lt 4 ]; then
109
 if [ ${#KEYID} -lt 4 ]; then
110
-    echo "gpg key for $MY_EMAIL_ADDRESS was not found"
110
+    echo $"gpg key for $MY_EMAIL_ADDRESS was not found"
111
     return 3682
111
     return 3682
112
 fi
112
 fi
113
 
113
 
115
                           grep 'pub ' | awk -F ' ' '{print $2}' | \
115
                           grep 'pub ' | awk -F ' ' '{print $2}' | \
116
                           awk -F '/' '{print $2}')
116
                           awk -F '/' '{print $2}')
117
 if [ ${#MY_BACKUP_KEY_ID} -lt 4 ]; then
117
 if [ ${#MY_BACKUP_KEY_ID} -lt 4 ]; then
118
-    echo "gpg backup key for '$MY_NAME' was not found"
118
+    echo $"gpg backup key for '$MY_NAME' was not found"
119
     return 58213
119
     return 58213
120
 fi
120
 fi
121
 
121
 
124
 KEYS_FILE=$FRAGMENTS_DIR/keyshare.asc
124
 KEYS_FILE=$FRAGMENTS_DIR/keyshare.asc
125
 gpg --output $FRAGMENTS_DIR/pubkey.txt --armor --export $KEYID
125
 gpg --output $FRAGMENTS_DIR/pubkey.txt --armor --export $KEYID
126
 if [ ! "$?" = "0" ]; then
126
 if [ ! "$?" = "0" ]; then
127
-    echo "Unable to extract public key for $KEYID"
127
+    echo $"Unable to extract public key for $KEYID"
128
     exit 7835
128
     exit 7835
129
 fi
129
 fi
130
 gpg --output $FRAGMENTS_DIR/privkey.txt \
130
 gpg --output $FRAGMENTS_DIR/privkey.txt \
131
     --armor --export-secret-key $KEYID
131
     --armor --export-secret-key $KEYID
132
 if [ ! "$?" = "0" ]; then
132
 if [ ! "$?" = "0" ]; then
133
-    echo "Unable to extract private key for $KEYID"
133
+    echo $"Unable to extract private key for $KEYID"
134
     exit 7823
134
     exit 7823
135
 fi
135
 fi
136
 gpg --output $FRAGMENTS_DIR/backup_pubkey.txt \
136
 gpg --output $FRAGMENTS_DIR/backup_pubkey.txt \
137
     --armor --export $MY_BACKUP_KEY_ID
137
     --armor --export $MY_BACKUP_KEY_ID
138
 if [ ! "$?" = "0" ]; then
138
 if [ ! "$?" = "0" ]; then
139
-    echo "Unable to extract backup public key for $MY_BACKUP_KEY_ID"
139
+    echo $"Unable to extract backup public key for $MY_BACKUP_KEY_ID"
140
     exit 62928
140
     exit 62928
141
 fi
141
 fi
142
 gpg --output $FRAGMENTS_DIR/backup_privkey.txt \
142
 gpg --output $FRAGMENTS_DIR/backup_privkey.txt \
143
     --armor --export-secret-key $MY_BACKUP_KEY_ID
143
     --armor --export-secret-key $MY_BACKUP_KEY_ID
144
 if [ ! "$?" = "0" ]; then
144
 if [ ! "$?" = "0" ]; then
145
-    echo "Unable to extract backup private key for $MY_BACKUP_KEY_ID"
145
+    echo $"Unable to extract backup private key for $MY_BACKUP_KEY_ID"
146
     exit 13783
146
     exit 13783
147
 fi
147
 fi
148
 
148
 
158
 KEY_SHARES=$((KEY_FRAGMENTS * 2))
158
 KEY_SHARES=$((KEY_FRAGMENTS * 2))
159
 gfsplit -n $KEY_FRAGMENTS -m $KEY_SHARES $KEYS_FILE
159
 gfsplit -n $KEY_FRAGMENTS -m $KEY_SHARES $KEYS_FILE
160
 if [ ! "$?" = "0" ]; then
160
 if [ ! "$?" = "0" ]; then
161
-    echo "Unable to split the gpg key"
161
+    echo $"Unable to split the gpg key"
162
     rm -rf $FRAGMENTS_DIR
162
     rm -rf $FRAGMENTS_DIR
163
     if [ -f $KEYS_FILE ]; then
163
     if [ -f $KEYS_FILE ]; then
164
         shred -zu $KEYS_FILE
164
         shred -zu $KEYS_FILE
171
 chown -R $MY_USERNAME:$MY_USERNAME $FRAGMENTS_DIR
171
 chown -R $MY_USERNAME:$MY_USERNAME $FRAGMENTS_DIR
172
 chmod -R 600 $FRAGMENTS_DIR
172
 chmod -R 600 $FRAGMENTS_DIR
173
 
173
 
174
-echo "$KEY_SHARES key shares created"
174
+echo $"$KEY_SHARES key shares created"
175
 
175
 
176
 exit 0
176
 exit 0

+ 1
- 1
src/freedombone-unignore Näytä tiedosto

41
 
41
 
42
 function show_help {
42
 function show_help {
43
     echo ''
43
     echo ''
44
-    echo 'freedombone-unignore -u [username] -e [mail address] -t [text in subject line]'
44
+    echo $'freedombone-unignore -u [username] -e [mail address] -t [text in subject line]'
45
     echo ''
45
     echo ''
46
     exit 0
46
     exit 0
47
 }
47
 }

+ 1
- 1
src/freedombone-xmpp-pass Näytä tiedosto

38
 
38
 
39
 function show_help {
39
 function show_help {
40
     echo ''
40
     echo ''
41
-    echo 'freedombone-xmpp-pass -e [email address]'
41
+    echo $'freedombone-xmpp-pass -e [email address]'
42
     echo ''
42
     echo ''
43
     exit 0
43
     exit 0
44
 }
44
 }