瀏覽代碼

Preparing for international strings

Bob Mottram 9 年之前
父節點
當前提交
ef9fcb946d

+ 38
- 38
src/freedombone 查看文件

@@ -461,49 +461,49 @@ LETSENCRYPT_SERVER='https://acme-v01.api.letsencrypt.org/directory'
461 461
 
462 462
 function show_help {
463 463
   echo ''
464
-  echo 'freedombone -c [configuration file]'
464
+  echo $'freedombone -c [configuration file]'
465 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 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 498
   echo ''
499
-  echo 'system types'
499
+  echo $'system types'
500 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 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 507
   echo ''
508 508
   exit 0
509 509
 }

+ 18
- 18
src/freedombone-addcert 查看文件

@@ -48,23 +48,23 @@ LETSENCRYPT_SERVER='https://acme-v01.api.letsencrypt.org/directory'
48 48
 
49 49
 function show_help {
50 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 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 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 68
     echo ''
69 69
     exit 0
70 70
 }
@@ -131,13 +131,13 @@ done
131 131
 
132 132
 if [ ! $HOSTNAME ]; then
133 133
 	if [ ! $LETSENCRYPT_HOSTNAME ]; then
134
-        echo 'No hostname specified'
134
+        echo $'No hostname specified'
135 135
         exit 5748
136 136
 	fi
137 137
 fi
138 138
 
139 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 141
     exit 5689
142 142
 fi
143 143
 
@@ -169,7 +169,7 @@ if [ $LETSENCRYPT_HOSTNAME ]; then
169 169
 	# TODO this requires user interaction - is there a non-interactive mode?
170 170
 	./letsencrypt-auto certonly --server $LETSENCRYPT_SERVER --standalone -d $LETSENCRYPT_HOSTNAME
171 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 173
 		exit 63216
174 174
 	fi
175 175
 

+ 1
- 1
src/freedombone-addemail 查看文件

@@ -40,7 +40,7 @@ GROUP_NAME=
40 40
 
41 41
 function show_help {
42 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 44
     echo ''
45 45
     exit 0
46 46
 }

+ 5
- 5
src/freedombone-addsipuser 查看文件

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

+ 30
- 30
src/freedombone-adduser 查看文件

@@ -43,17 +43,17 @@ SIP_EXTENSION=
43 43
 FULLBLOG_DOMAIN_NAME=
44 44
 
45 45
 if [ ! $MY_USERNAME ]; then
46
-    echo 'No username was given'
46
+    echo $'No username was given'
47 47
     exit 1
48 48
 fi
49 49
 
50 50
 if [ -d /home/$MY_USERNAME ]; then
51
-    echo "The user $MY_USERNAME already exists"
51
+    echo $"The user $MY_USERNAME already exists"
52 52
     exit 2
53 53
 fi
54 54
 
55 55
 if [ ! -f $COMPLETION_FILE ]; then
56
-    echo "$COMPLETION_FILE not found"
56
+    echo $"$COMPLETION_FILE not found"
57 57
     userdel -r $MY_USERNAME
58 58
     exit 3
59 59
 fi
@@ -63,7 +63,7 @@ useradd -m -p "$NEW_USER_PASSWORD" -s /bin/bash $MY_USERNAME
63 63
 adduser $MY_USERNAME sasl
64 64
 
65 65
 if [ ! -d /home/$MY_USERNAME ]; then
66
-    echo 'Home directory was not created'
66
+    echo $'Home directory was not created'
67 67
     exit 4
68 68
 fi
69 69
 
@@ -73,15 +73,15 @@ if [ "$SSH_PUBLIC_KEY" ]; then
73 73
             mkdir /home/$MY_USERNAME/.ssh
74 74
             cp $SSH_PUBLIC_KEY /home/$MY_USERNAME/.ssh/authorized_keys
75 75
             chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.ssh
76
-            echo 'ssh public key installed'
76
+            echo $'ssh public key installed'
77 77
         else
78 78
             if [[ "$SSH_PUBLIC_KEY" == "ssh-"* ]]; then
79 79
                 mkdir /home/$MY_USERNAME/.ssh
80 80
                 echo "$SSH_PUBLIC_KEY" > /home/$MY_USERNAME/.ssh/authorized_keys
81 81
                 chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.ssh
82
-                echo 'ssh public key installed'
82
+                echo $'ssh public key installed'
83 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 85
                 exit 5
86 86
             fi
87 87
         fi
@@ -89,7 +89,7 @@ if [ "$SSH_PUBLIC_KEY" ]; then
89 89
 fi
90 90
 
91 91
 if [ ! -d /home/$MY_USERNAME/Maildir ]; then
92
-    echo 'Email directory was not created'
92
+    echo $'Email directory was not created'
93 93
     userdel -r $MY_USERNAME
94 94
     exit 6
95 95
 fi
@@ -142,7 +142,7 @@ fi
142 142
 # encrypt outgoing mail to the "sent" folder
143 143
 if ! grep -q "pgp_encrypt_only_command" /home/$MY_USERNAME/.muttrc; then
144 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 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 147
 else
148 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,12 +157,12 @@ fi
157 157
 if ! grep -q "Change your GPG password" /home/$MY_USERNAME/README; then
158 158
     echo '' >> /home/$MY_USERNAME/README
159 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 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 166
     echo '' >> /home/$MY_USERNAME/README
167 167
     echo "  gpg --edit-key $MY_GPG_PUBLIC_KEY_ID" >> /home/$MY_USERNAME/README
168 168
     echo '  passwd' >> /home/$MY_USERNAME/README
@@ -173,10 +173,10 @@ fi
173 173
 if ! grep -q "Publish your GPG public key" /home/$MY_USERNAME/README; then
174 174
     echo '' >> /home/$MY_USERNAME/README
175 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 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 180
     echo '' >> /home/$MY_USERNAME/README
181 181
     echo "  gpg --send-keys $MY_GPG_PUBLIC_KEY_ID" >> /home/$MY_USERNAME/README
182 182
 fi
@@ -186,10 +186,10 @@ chown $MY_USERNAME:$MY_USERNAME $MY_GPG_PUBLIC_KEY
186 186
 chmod 600 /home/$MY_USERNAME/README
187 187
 
188 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 190
     freedombone-addxmpp -e "$MY_USERNAME@$HOSTNAME" -p "$NEW_USER_PASSWORD"
191 191
     if [ ! "$?" = "0" ]; then
192
-        echo "XMPP account not created"
192
+        echo $"XMPP account not created"
193 193
         userdel -r $MY_USERNAME
194 194
         exit 8
195 195
     fi
@@ -198,7 +198,7 @@ fi
198 198
 if grep -q "Blog domain" $COMPLETION_FILE; then
199 199
     FULLBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Blog domain" | awk -F ':' '{print $2}')
200 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 202
         if grep -q "install_xmpp" $COMPLETION_FILE; then
203 203
             freedombone-rmxmpp -e "$MY_USERNAME@$HOSTNAME"
204 204
         fi
@@ -217,7 +217,7 @@ if grep -q "install_sip" $COMPLETION_FILE; then
217 217
     SIP_EXTENSION=$(freedombone-sipfreeext)
218 218
     freedombone-addsipuser -u $MY_USERNAME -e $SIP_EXTENSION -p "$NEW_USER_PASSWORD"
219 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 221
         if grep -q "install_xmpp" $COMPLETION_FILE; then
222 222
             freedombone-rmxmpp -e "$MY_USERNAME@$HOSTNAME"
223 223
         fi
@@ -255,21 +255,21 @@ fi
255 255
 #fi
256 256
 
257 257
 clear
258
-echo "New user $MY_USERNAME was created"
258
+echo $"New user $MY_USERNAME was created"
259 259
 if [ $SIP_EXTENSION ]; then
260
-    echo "Their SIP phone extension is $SIP_EXTENSION"
260
+    echo $"Their SIP phone extension is $SIP_EXTENSION"
261 261
 fi
262
-echo "Their login password is $NEW_USER_PASSWORD"
262
+echo $"Their login password is $NEW_USER_PASSWORD"
263 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 267
 echo ''
268
-echo "They can download their GPG keys with:"
268
+echo $"They can download their GPG keys with:"
269 269
 echo ''
270 270
 echo "    scp -P $SSH_PORT -r $MY_USERNAME@$HOSTNAME:/home/$MY_USERNAME/.gnupg ~/"
271 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 275
 exit 0

+ 2
- 2
src/freedombone-addxmpp 查看文件

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

+ 4
- 4
src/freedombone-client 查看文件

@@ -103,7 +103,7 @@ function configure_ssh_client {
103 103
   ssh_remove_small_moduli
104 104
 
105 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 107
   echo ''
108 108
   echo $(cat /home/$CURR_USER/.ssh/id_rsa.pub)
109 109
   echo $(cat /home/$CURR_USER/.ssh/id_ed25519.pub)
@@ -477,7 +477,7 @@ function mesh_batman {
477 477
 
478 478
 function show_help {
479 479
     echo ''
480
-    echo 'freedombone-client'
480
+    echo $'freedombone-client'
481 481
     echo ''
482 482
     exit 0
483 483
 }
@@ -505,9 +505,9 @@ esac
505 505
 shift
506 506
 done
507 507
 
508
-echo 'Configuring client'
508
+echo $'Configuring client'
509 509
 configure_ssh_client
510 510
 mesh_batman
511 511
 mesh_babel
512
-echo 'Configuration complete'
512
+echo $'Configuration complete'
513 513
 exit 0

+ 11
- 11
src/freedombone-clientcert 查看文件

@@ -47,12 +47,12 @@ EXTENSIONS=""
47 47
 
48 48
 function show_help {
49 49
     echo ''
50
-    echo 'freedombone-clientcert -u [username]'
50
+    echo $'freedombone-clientcert -u [username]'
51 51
     echo ''
52
-    echo 'Creates email certificates for use with IMAP clients'
52
+    echo $'Creates email certificates for use with IMAP clients'
53 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 56
     echo ''
57 57
     exit 0
58 58
 }
@@ -77,17 +77,17 @@ shift
77 77
 done
78 78
 
79 79
 if [ ! $USERNAME ]; then
80
-    echo 'No username specified'
80
+    echo $'No username specified'
81 81
     exit 5748
82 82
 fi
83 83
 
84 84
 if [ ! -d /home/$USERNAME ]; then
85
-    echo "User $USERNAME not found"
85
+    echo $"User $USERNAME not found"
86 86
     exit 76239
87 87
 fi
88 88
 
89 89
 if [ -d /home/$USERNAME/emailcert ]; then
90
-    echo 'Client certs were already for created'
90
+    echo $'Client certs were already for created'
91 91
     exit 2953
92 92
 fi
93 93
 
@@ -106,7 +106,7 @@ chmod 600 /etc/dovecot/passwd-file
106 106
 freedombone-addcert -h $USERNAME --nodh ""
107 107
 
108 108
 if [ ! -f /etc/ssl/private/$USERNAME.key ]; then
109
-    echo 'User certificates were not created'
109
+    echo $'User certificates were not created'
110 110
     rm -rf /home/$USERNAME/emailcert
111 111
     exit 74835
112 112
 fi
@@ -118,7 +118,7 @@ openssl req -new -sha256 -subj \
118 118
         -out /etc/ssl/requests/$USERNAME.csr
119 119
 
120 120
 if [ ! -f /etc/ssl/requests/$USERNAME.csr ]; then
121
-    echo 'Certificate request was not created'
121
+    echo $'Certificate request was not created'
122 122
     rm -rf /home/$USERNAME/emailcert
123 123
     exit 83520
124 124
 fi
@@ -130,7 +130,7 @@ openssl ca -config /etc/ssl/dovecot-ca.cnf \
130 130
         -out /etc/ssl/certs/$USERNAME.cer
131 131
 
132 132
 if [ ! -f /etc/ssl/certs/$USERNAME.cer ]; then
133
-    echo 'Authentication certificate was not created'
133
+    echo $'Authentication certificate was not created'
134 134
     rm -rf /home/$USERNAME/emailcert
135 135
     exit 343569
136 136
 fi
@@ -167,7 +167,7 @@ chmod +x /home/$USERNAME/emailcert/install.sh
167 167
 
168 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 171
 echo ''
172 172
 echo "      scp -P 2222 -r $USERNAME@$HOSTNAME:/home/$USERNAME/emailcert ~/"
173 173
 echo ''

+ 7
- 7
src/freedombone-format 查看文件

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

+ 1
- 1
src/freedombone-ignore 查看文件

@@ -41,7 +41,7 @@ SUBJECT_TEXT=
41 41
 
42 42
 function show_help {
43 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 45
     echo ''
46 46
     exit 0
47 47
 }

+ 10
- 10
src/freedombone-image 查看文件

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

+ 9
- 9
src/freedombone-image-customise 查看文件

@@ -60,7 +60,7 @@ enable_eatmydata_override() {
60 60
     chroot $rootdir apt-get install --no-install-recommends -y eatmydata
61 61
     if [ -x $rootdir/usr/bin/eatmydata ] && \
62 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 64
         printf "#!/bin/sh\nexec eatmydata dpkg \"\$@\"\n" \
65 65
             > $rootdir/var/tmp/dpkg-eatmydata
66 66
         chmod 755 $rootdir/var/tmp/dpkg-eatmydata
@@ -68,7 +68,7 @@ enable_eatmydata_override() {
68 68
 Dir::Bin::dpkg "/var/tmp/dpkg-eatmydata";
69 69
 EOF
70 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 72
     fi
73 73
 }
74 74
 
@@ -76,11 +76,11 @@ disable_eatmydata_override() {
76 76
     for override in \
77 77
         /etc/apt/apt.conf.d/95debian-edu-install-dpkg-eatmydata \
78 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 80
         if [ -f $rootdir$override ] ; then
81 81
             rm -f $rootdir$override
82 82
         else
83
-            echo "warning: missing $rootdir$override"
83
+            echo $"warning: missing $rootdir$override"
84 84
         fi
85 85
     done
86 86
     sync # Flush file buffers before continuing
@@ -151,7 +151,7 @@ iface eth0 inet static
151 151
     sed -i "/nameserver $NAMESERVER1/a\nameserver $NAMESERVER2" $rootdir/etc/resolv.conf
152 152
 
153 153
     # change the motd to show further install instructions
154
-    echo "
154
+    echo $"
155 155
  .---.                  .              .
156 156
  |                      |              |
157 157
  |--- .--. .-.  .-.  .-.|  .-. .--.--. |.-.  .-. .--.  .-.
@@ -179,9 +179,9 @@ configure_ssh() {
179 179
         echo "$SSH_PUBKEY" > $rootdir/home/$MY_USERNAME/.ssh/authorized_keys
180 180
         chroot $rootdir chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.ssh
181 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 183
         echo $SSH_PUBKEY
184
-        echo 'Password ssh authentication turned off'
184
+        echo $'Password ssh authentication turned off'
185 185
     fi
186 186
 }
187 187
 
@@ -300,7 +300,7 @@ export LC_ALL=C LANGUAGE=C LANG=C
300 300
 export TMP=/tmp/ TMPDIR=/tmp/
301 301
 
302 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 304
 password=$MY_PASSWORD
305 305
 chroot "$rootdir" adduser --gecos $username --disabled-password $username
306 306
 echo $username:$password | chroot $rootdir /usr/sbin/chpasswd
@@ -389,5 +389,5 @@ create_generic_image
389 389
 continue_installation
390 390
 
391 391
 cd /
392
-echo "info: killing leftover processes in chroot"
392
+echo $"info: killing leftover processes in chroot"
393 393
 fuser -mvk $rootdir/. || true

+ 1
- 1
src/freedombone-image-hardware-setup 查看文件

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

+ 4
- 4
src/freedombone-image-make 查看文件

@@ -58,7 +58,7 @@ vendor_dir="${basedir}/vendor"
58 58
 vmdebootstrap_dir="${vendor_dir}/vmdebootstrap"
59 59
 
60 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 62
     exit 1
63 63
 fi
64 64
 
@@ -145,7 +145,7 @@ else
145 145
     VMDEBOOTSTRAP=vmdebootstrap
146 146
 fi
147 147
 
148
-echo 'Making customised customisation script'
148
+echo $'Making customised customisation script'
149 149
 TEMP_CUSTOMISE=/etc/${PROJECT_NAME}/image-customise
150 150
 if [ -f /usr/local/bin/${PROJECT_NAME}-image-customise ]; then
151 151
     sudo cp /usr/local/bin/${PROJECT_NAME}-image-customise $TEMP_CUSTOMISE
@@ -163,7 +163,7 @@ sudo sed -i "s|CONFIG_FILENAME=.*|CONFIG_FILENAME=${CONFIG_FILENAME}|g" $TEMP_CU
163 163
 sudo sed -i "s|SSH_PUBKEY=.*|SSH_PUBKEY=${SSH_PUBKEY}|g" $TEMP_CUSTOMISE
164 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 167
 # Run vmdebootstrap script to create image
168 168
 sudo -H \
169 169
     SUITE="$SUITE" \
@@ -188,5 +188,5 @@ sudo -H \
188 188
     $extra_opts \
189 189
     $pkgopts
190 190
 
191
-echo 'Removing customised customisation script'
191
+echo $'Removing customised customisation script'
192 192
 sudo shred -zu $TEMP_CUSTOMISE

+ 19
- 19
src/freedombone-keydrive 查看文件

@@ -43,7 +43,7 @@ FORMAT="no"
43 43
 
44 44
 function show_help {
45 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 47
     echo ''
48 48
     exit 0
49 49
 }
@@ -84,17 +84,17 @@ shift
84 84
 done
85 85
 
86 86
 if [ ! $MY_USERNAME ]; then
87
-    echo 'No username given'
87
+    echo $'No username given'
88 88
     exit 69350
89 89
 fi
90 90
 
91 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 93
     exit 72378
94 94
 fi
95 95
 
96 96
 if [ ! -b $USB_DRIVE ]; then
97
-  echo 'Please attach a USB drive'
97
+  echo $'Please attach a USB drive'
98 98
   exit 65743
99 99
 fi
100 100
 
@@ -121,7 +121,7 @@ if [ "$?" = "0" ]; then
121 121
 fi
122 122
 mount $USB_DRIVE $USB_MOUNT
123 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 125
   rm -rf $USB_MOUNT
126 126
   exit 78543
127 127
 fi
@@ -129,16 +129,16 @@ fi
129 129
 # optionally create a master drive which contains the full GPG keyring
130 130
 if [[ $MASTER_DRIVE == "yes" || $MASTER_DRIVE == "y" || $MASTER_DRIVE == "1" ]]; then
131 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 133
       umount -f $USB_MOUNT
134 134
       rm -rf $USB_MOUNT
135 135
       exit 73025
136 136
   fi
137 137
   cp -rf /home/$MY_USERNAME/.gnupg $USB_MOUNT
138 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 140
   else
141
-      echo "Unable to copy gpg keyring to $USB_DRIVE"
141
+      echo $"Unable to copy gpg keyring to $USB_DRIVE"
142 142
   fi
143 143
   umount -f $USB_MOUNT
144 144
   rm -rf $USB_MOUNT
@@ -147,8 +147,8 @@ fi
147 147
 
148 148
 # Don't use the USB drive if it already contains a full keyring
149 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 152
   umount -f $USB_MOUNT
153 153
   rm -rf $USB_MOUNT
154 154
   exit 3392
@@ -164,10 +164,10 @@ FRAGMENTS_DIR=$FRAGMENTS_DIR/$MY_USERNAME
164 164
 # make a directory to contain the fragments
165 165
 if [ ! -d $FRAGMENTS_DIR ]; then
166 166
   mkdir -p $FRAGMENTS_DIR
167
-  echo "Made directory $FRAGMENTS_DIR"
167
+  echo $"Made directory $FRAGMENTS_DIR"
168 168
 fi
169 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 171
   umount -f $USB_MOUNT
172 172
   rm -rf $USB_MOUNT
173 173
   exit 6843
@@ -179,7 +179,7 @@ if [ ! "$?" = "0" ]; then
179 179
     no_of_usb_shares=0
180 180
 fi
181 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 183
     cd ~/
184 184
     umount -f $USB_MOUNT
185 185
     rm -rf $USB_MOUNT
@@ -208,7 +208,7 @@ if (( no_of_local_shares < 3 )); then
208 208
 fi
209 209
 
210 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 212
     cd ~/
213 213
     umount -f $USB_MOUNT
214 214
     rm -rf $USB_MOUNT
@@ -221,9 +221,9 @@ SHARE_FILENAME=${share_files[RANDOM % ${#share_files[@]}]}
221 221
 cp -f $SHARE_FILENAME $FRAGMENTS_DIR
222 222
 cd $FRAGMENTS_DIR
223 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 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 227
     ls $FRAGMENTS_DIR
228 228
     cd ~/
229 229
     umount -f $USB_MOUNT
@@ -231,8 +231,8 @@ if (( no_of_usb_shares > 1 )); then
231 231
     exit 54292
232 232
 fi
233 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 236
     ls $FRAGMENTS_DIR
237 237
     cd ~/
238 238
     umount -f $USB_MOUNT
@@ -243,6 +243,6 @@ fi
243 243
 cd ~/
244 244
 umount -f $USB_MOUNT
245 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 248
 exit 0

+ 27
- 27
src/freedombone-mesh 查看文件

@@ -79,14 +79,14 @@ function install_toxcore {
79 79
     sudo cp /usr/local/lib/libtoxcore* /usr/lib/
80 80
 
81 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 83
         exit 73862
84 84
     fi
85 85
 
86 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 87
     sudo chmod 700 /var/lib/tox-bootstrapd
88 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 90
         exit 476835
91 91
     fi
92 92
 
@@ -106,7 +106,7 @@ function install_toxcore {
106 106
 
107 107
     if [ -f /bin/systemctl ]; then
108 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 110
             exit 7359
111 111
         fi
112 112
         sudo cp ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service /etc/systemd/system/
@@ -129,7 +129,7 @@ function install_toxcore {
129 129
 
130 130
     TOX_PUBLIC_KEY=$(cat /var/log/syslog | grep tox | grep "Public Key" | awk -F ' ' '{print $8}' | tail -1)
131 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 133
         exit 6529
134 134
     fi
135 135
 
@@ -149,7 +149,7 @@ function install_toxid {
149 149
     sudo make install
150 150
 
151 151
     if [ ! -f /usr/local/bin/toxid ]; then
152
-        echo "Couldn't install toxid"
152
+        echo $"Couldn't install toxid"
153 153
         exit 6389
154 154
     fi
155 155
 
@@ -178,7 +178,7 @@ function run_tox {
178 178
         # get a list of peers
179 179
         PEER_TOX_ID_LIST=$(lstox | grep $AVAHI_DOMAIN | sort -u)
180 180
         if [ ! "$PEER_TOX_ID_LIST" ]; then
181
-            echo 'No peers found'
181
+            echo $'No peers found'
182 182
             exit 0
183 183
         fi
184 184
         PEER_TOX_ID_LIST_COUNT=$(echo "$PEER_TOX_ID_LIST" | wc -l)
@@ -189,7 +189,7 @@ function run_tox {
189 189
         else
190 190
             # choose a user from a list
191 191
             echo ''
192
-            echo "Select a user on $AVAHI_DOMAIN:"
192
+            echo $"Select a user on $AVAHI_DOMAIN:"
193 193
             ctr=0
194 194
             while IFS='' read -r line || [[ -n "$line" ]]; do
195 195
                 toxusername=$(echo $line | awk -F ' ' '{print $2}')
@@ -204,7 +204,7 @@ function run_tox {
204 204
         if [ ${#PEER_TOX_ID} -gt 30 ]; then
205 205
             # start client and make a friend request
206 206
             if [ -f $QTOX_INI ]; then
207
-                echo 'Launch qTox'
207
+                echo $'Launch qTox'
208 208
                 qtox &
209 209
             else
210 210
 
@@ -220,7 +220,7 @@ function run_tox {
220 220
         else
221 221
             # ID was invalid
222 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 224
             exit 6
225 225
         fi
226 226
     fi
@@ -258,7 +258,7 @@ fi
258 258
 avahi-browse -atl | awk -F ' ' '{print $4}' | sort -u > $PEERS_FILE
259 259
 
260 260
 if [ ! -f $PEERS_FILE ]; then
261
-   echo 'No peers were found'
261
+   echo $'No peers were found'
262 262
    exit 0
263 263
 fi
264 264
 
@@ -268,7 +268,7 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
268 268
 done < "$PEERS_FILE"
269 269
 
270 270
 if [ ${ctr} -lt "1" ]; then
271
-   echo 'No peers were found'
271
+   echo $'No peers were found'
272 272
    exit 0
273 273
 fi
274 274
 
@@ -279,9 +279,9 @@ echo "|                      |              |                   "
279 279
 echo "|--- .--. .-.  .-.  .-.|  .-. .--.--. |.-.  .-. .--.  .-. "
280 280
 echo "|    |   (.-' (.-' (   | (   )|  |  | |   )(   )|  | (.-' "
281 281
 echo "'    '     --'  --'  -' -  -' '  '   -' -'   -' '   -  --'"
282
-echo '                    Freedom in the Mesh'
282
+echo $'                    Freedom in the Mesh'
283 283
 echo ''
284
-echo 'Please choose a peer to connect to:'
284
+echo $'Please choose a peer to connect to:'
285 285
 idx=1
286 286
 while IFS='' read -r line || [[ -n "$line" ]]; do
287 287
     echo "    $idx. $line"
@@ -293,7 +293,7 @@ read peer_index
293 293
 
294 294
 # if no selection made
295 295
 if [ ! $peer_index ]; then
296
-    echo 'Nothing was selected'
296
+    echo $'Nothing was selected'
297 297
     echo ''
298 298
     exit 0
299 299
 fi
@@ -309,7 +309,7 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
309 309
 done < "$PEERS_FILE"
310 310
 
311 311
 if [ ! $AVAHI_DOMAIN ]; then
312
-    echo 'No domain name'
312
+    echo $'No domain name'
313 313
     exit 3
314 314
 fi
315 315
 
@@ -319,7 +319,7 @@ if [ ! -f $TOXIC_PATH ]; then
319 319
         $MUMBLE_PATH &
320 320
         exit 0
321 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 323
     if [[ $SERVER_INSTALLATION == "no" ]]; then
324 324
         sudo batman stop
325 325
     fi
@@ -332,16 +332,16 @@ if [ ! -f $MUMBLE_PATH ]; then
332 332
 fi
333 333
 
334 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 338
 echo ''
339 339
 
340 340
 read peer_index
341 341
 
342 342
 # if no selection made
343 343
 if [ ! $peer_index ]; then
344
-    echo 'Nothing was selected'
344
+    echo $'Nothing was selected'
345 345
     echo ''
346 346
     exit 0
347 347
 fi
@@ -349,18 +349,18 @@ fi
349 349
 if [[ $peer_index == 1 ]]; then
350 350
     if [ -f $MUMBLE_PATH ]; then
351 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 357
         echo ''
358
-        echo 'Press Enter to continue.'
358
+        echo $'Press Enter to continue.'
359 359
         echo ''
360 360
         read peer_index
361 361
         $MUMBLE_PATH &
362 362
     else
363
-        echo 'Mumble may not be installed on this system'
363
+        echo $'Mumble may not be installed on this system'
364 364
         exit 5
365 365
     fi
366 366
 fi

+ 36
- 36
src/freedombone-meshweb 查看文件

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

+ 29
- 29
src/freedombone-prep 查看文件

@@ -71,9 +71,9 @@ CURR_DIR=$(pwd)
71 71
 
72 72
 function show_help {
73 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 75
     echo ''
76
-    echo 'See the manpage for more details'
76
+    echo $'See the manpage for more details'
77 77
     echo ''
78 78
 }
79 79
 
@@ -154,8 +154,8 @@ if [ -d /media ]; then
154 154
     fi
155 155
 fi
156 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 159
     exit 67563
160 160
 fi
161 161
 
@@ -214,9 +214,9 @@ done
214 214
 
215 215
 
216 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 220
     echo ''
221 221
     echo '  ls /dev/sd*'
222 222
     echo ''
@@ -224,7 +224,7 @@ if [ ! $MICROSD_DRIVE ]; then
224 224
     echo ''
225 225
     echo '  ls /dev/mmcblk*'
226 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 228
     exit 1
229 229
 fi
230 230
 
@@ -232,7 +232,7 @@ if [ ! -b ${MICROSD_DRIVE}${PARTITION_NUMBER} ]; then
232 232
     if [ -b ${MICROSD_DRIVE}p${PARTITION_NUMBER} ]; then
233 233
         PARTITION_NUMBER=p${PARTITION_NUMBER}
234 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 236
         exit 2
237 237
     fi
238 238
 fi
@@ -258,7 +258,7 @@ if [ $DEBIAN_IMAGE_FILENAME ]; then
258 258
         DEBIAN_IMAGE_FILENAME=${files[0]}
259 259
     fi
260 260
     if [[ $DEBIAN_IMAGE_FILENAME != *".img" ]]; then
261
-        echo 'Debian image (.img) file expected'
261
+        echo $'Debian image (.img) file expected'
262 262
         exit 62394
263 263
     fi
264 264
     DEBIAN_FILE_NAME=$DEBIAN_IMAGE_FILENAME
@@ -278,12 +278,12 @@ else
278 278
 fi
279 279
 
280 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 282
     exit 4
283 283
 fi
284 284
 
285 285
 cd ~/freedombone
286
-echo 'Flashing image. This may take a while.'
286
+echo $'Flashing image. This may take a while.'
287 287
 #$SUDO dd if=$DEBIAN_FILE_NAME of=$MICROSD_DRIVE
288 288
 sync
289 289
 
@@ -298,24 +298,24 @@ sync
298 298
 
299 299
 if [ ! -b ${MICROSD_DRIVE}${PARTITION_NUMBER} ]; then
300 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 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 305
         exit 5
306 306
     fi
307 307
 fi
308 308
 
309 309
 if [ ! -d $MICROSD_MOUNT_POINT/$ROOTFS ]; then
310 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 312
     ls $MICROSD_MOUNT_POINT
313 313
     exit 65688
314 314
 fi
315 315
 
316 316
 if [ ! -d $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/home ]; then
317 317
     echo ''
318
-    echo "The rootfs partition was not written correctly."
318
+    echo $"The rootfs partition was not written correctly."
319 319
     ls $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR
320 320
     exit 65688
321 321
 fi
@@ -328,7 +328,7 @@ $SUDO cp -f $(which zeronetavahi)* $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/us
328 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 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 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 332
     exit 8736
333 333
 fi
334 334
 
@@ -339,18 +339,18 @@ fi
339 339
 
340 340
 # change the motd to show further install instructions
341 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 343
 echo '' >> /tmp/freedombone_motd
344 344
 echo '    adduser [username]' >> /tmp/freedombone_motd
345 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 348
 echo '' >> /tmp/freedombone_motd
349 349
 echo "    ssh [username]@$BOX_IP_ADDRESS" >> /tmp/freedombone_motd
350 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 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 354
 echo '' >> /tmp/freedombone_motd
355 355
 echo '    apt-get update' >> /tmp/freedombone_motd
356 356
 echo '    apt-get -y install git dialog build-essential' >> /tmp/freedombone_motd
@@ -359,17 +359,17 @@ echo '    freedombone menuconfig' >> /tmp/freedombone_motd
359 359
 $SUDO cp -f /tmp/freedombone_motd $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/etc/motd
360 360
 
361 361
 clear
362
-echo '*** Initial microSD card setup is complete ***'
362
+echo $'*** Initial microSD card setup is complete ***'
363 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 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 369
 echo ''
370 370
 echo "    ssh root@$BOX_IP_ADDRESS"
371 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 373
 cat /tmp/freedombone_motd
374 374
 rm /tmp/freedombone_motd
375 375
 $SUDO umount $MICROSD_MOUNT_POINT/$ROOTFS

+ 15
- 15
src/freedombone-recoverkey 查看文件

@@ -39,8 +39,8 @@ GPG_USB_DRIVE='sdb1'
39 39
 
40 40
 function show_help {
41 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 44
     echo ''
45 45
     exit 0
46 46
 }
@@ -78,16 +78,16 @@ if [ ! $MY_USERNAME ]; then
78 78
     show_help
79 79
 fi
80 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 82
     exit 7270
83 83
 fi
84 84
 
85 85
 if [ ! $MY_USERNAME ]; then
86
-    echo 'No username given'
86
+    echo $'No username given'
87 87
     exit 3578
88 88
 fi
89 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 91
     exit 7270
92 92
 fi
93 93
 
@@ -117,7 +117,7 @@ function reconstruct_key {
117 117
 
118 118
     su -c "gpg --allow-secret-key-import --import $KEYS_FILE" - $MY_USERNAME
119 119
     if [ ! "$?" = "0" ]; then
120
-        echo 'Unable to import gpg key'
120
+        echo $'Unable to import gpg key'
121 121
         shred -zu $KEYS_FILE
122 122
         rm -rf /home/$MY_USERNAME/.tempgnupg
123 123
         exit 9654
@@ -256,13 +256,13 @@ if [ $FRIENDS_SERVERS_LIST ]; then
256 256
                 mkdir -p /home/$MY_USERNAME/.gnupg_fragments
257 257
             fi
258 258
 
259
-            echo -n "Starting key retrieval from $REMOTE_SERVER..."
259
+            echo -n $"Starting key retrieval from $REMOTE_SERVER..."
260 260
             /usr/bin/sshpass -p $REMOTE_PASSWORD \
261 261
                              scp -r -P $REMOTE_SSH_PORT $REMOTE_SERVER/.gnupg_fragments/* /home/$MY_USERNAME/.gnupg_fragments
262 262
             if [ ! "$?" = "0" ]; then
263
-                echo 'FAILED'
263
+                echo $'FAILED'
264 264
             else
265
-                echo 'Ok'
265
+                echo $'Ok'
266 266
             fi
267 267
         fi
268 268
     done < $FRIENDS_SERVERS_LIST
@@ -270,7 +270,7 @@ fi
270 270
 
271 271
 # was a directory created?
272 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 274
     exit 7483
275 275
 fi
276 276
 
@@ -278,7 +278,7 @@ fi
278 278
 cd $FRAGMENTS_DIR
279 279
 no_of_shares=$(ls -afq keyshare.asc.* | wc -l)
280 280
 if (( no_of_shares == 0 )); then
281
-    echo 'No key fragments were retrieved'
281
+    echo $'No key fragments were retrieved'
282 282
     exit 76882
283 283
 fi
284 284
 
@@ -291,16 +291,16 @@ cd $FRAGMENTS_DIR
291 291
 gfcombine $KEYS_FILE.*
292 292
 
293 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 295
     exit 6283
296 296
 fi
297 297
 
298
-echo 'Key fragments recombined'
298
+echo $'Key fragments recombined'
299 299
 
300 300
 # import the gpg key
301 301
 su -c "gpg --allow-secret-key-import --import $KEYS_FILE" - $MY_USERNAME
302 302
 if [ ! "$?" = "0" ]; then
303
-    echo 'Unable to import gpg key'
303
+    echo $'Unable to import gpg key'
304 304
     shred -zu $KEYS_FILE
305 305
     exit 3682
306 306
 fi
@@ -308,6 +308,6 @@ shred -zu $KEYS_FILE
308 308
 chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.gnupg
309 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 313
 exit 0

+ 14
- 14
src/freedombone-remote 查看文件

@@ -57,17 +57,17 @@ RECIPROCAL="no"
57 57
 
58 58
 function show_help {
59 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 61
   echo ''
62
-  echo 'Creates an inventory of remote backup locations'
62
+  echo $'Creates an inventory of remote backup locations'
63 63
   echo ''
64 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 71
   echo ''
72 72
   exit 0
73 73
 }
@@ -117,12 +117,12 @@ done
117 117
 
118 118
 function interactive_configuration_remote_backups {
119 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 121
       exit 7356
122 122
   fi
123 123
 
124 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 126
       exit 3689
127 127
   fi
128 128
 
@@ -238,17 +238,17 @@ function interactive_configuration_remote_backups {
238 238
 function show_result {
239 239
   clear
240 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 242
       exit 0
243 243
   fi
244 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 246
       exit 7358
247 247
   fi
248 248
   echo ''
249
-  echo "Remote backups list: $FRIENDS_SERVERS_LIST"
249
+  echo $"Remote backups list: $FRIENDS_SERVERS_LIST"
250 250
   echo ''
251
-  echo 'Contents:'
251
+  echo $'Contents:'
252 252
   echo ''
253 253
   cat $FRIENDS_SERVERS_LIST
254 254
   echo ''

+ 26
- 26
src/freedombone-renew-cert 查看文件

@@ -40,32 +40,32 @@ LETSENCRYPT_SERVER='https://acme-v01.api.letsencrypt.org/directory'
40 40
 
41 41
 function show_help {
42 42
     echo ''
43
-    echo 'freedombone-renew-cert -h [hostname] -p [provider]'
43
+    echo $'freedombone-renew-cert -h [hostname] -p [provider]'
44 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 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 50
     echo ''
51 51
     exit 0
52 52
 }
53 53
 
54 54
 function renew_letsencrypt {
55 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 57
         freedombone-addcert -e $HOSTNAME -s $LETSENCRYPT_SERVER --dhkey $DH_KEYLENGTH
58 58
         if [ ! "$?" = "0" ]; then
59
-            echo "Unable to add Let's encrypt certificate"
59
+            echo $"Unable to add Let's encrypt certificate"
60 60
             exit 6328
61 61
         fi
62 62
     else
63
-        echo "Renewing Let's Encrypt certificate"
63
+        echo $"Renewing Let's Encrypt certificate"
64 64
         letsencrypt renew \
65 65
                     --cert-path /etc/letsencrypt/live/${HOSTNAME}/fullchain.pem \
66 66
                     --key-path /etc/letsencrypt/live/${HOSTNAME}/privkey.pem
67 67
         if [ ! "$?" = "0" ]; then
68
-            echo "Unable to renew Let's encrypt certificate"
68
+            echo $"Unable to renew Let's encrypt certificate"
69 69
             exit 2624
70 70
         fi
71 71
     fi
@@ -76,10 +76,10 @@ function renew_letsencrypt {
76 76
 }
77 77
 
78 78
 function renew_startssl {
79
-    echo 'Renewing StartSSL certificate'
79
+    echo $'Renewing StartSSL certificate'
80 80
     if [ -s /etc/ssl/certs/$HOSTNAME.new.crt ]; then
81 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 83
             return
84 84
         fi
85 85
 
@@ -137,18 +137,18 @@ function renew_startssl {
137 137
         # update your site to include the bundle
138 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 141
         service nginx restart
142 142
         return
143 143
     fi
144 144
 
145 145
     if [ -f /etc/ssl/requests/$HOSTNAME.csr ]; then
146
-        echo 'Certificate request already created:'
146
+        echo $'Certificate request already created:'
147 147
         echo ''
148 148
         cat /etc/ssl/requests/$HOSTNAME.csr
149 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 152
         echo ''
153 153
         return
154 154
     fi
@@ -162,14 +162,14 @@ function renew_startssl {
162 162
     echo ''
163 163
     cat /etc/ssl/requests/$HOSTNAME.csr
164 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 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 173
     echo ''
174 174
 }
175 175
 
@@ -197,18 +197,18 @@ shift
197 197
 done
198 198
 
199 199
 if [ ! $HOSTNAME ]; then
200
-    echo 'No hostname specified'
200
+    echo $'No hostname specified'
201 201
     exit 5748
202 202
 fi
203 203
 
204 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 206
     exit 5689
207 207
 fi
208 208
 
209 209
 # check that the web site exists
210 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 212
     exit 7598
213 213
 fi
214 214
 
@@ -218,7 +218,7 @@ else
218 218
     if [[ $PROVIDER == 'letsencrypt' ]]; then
219 219
         renew_letsencrypt
220 220
     else
221
-        echo "$PROVIDER is not currently supported"
221
+        echo $"$PROVIDER is not currently supported"
222 222
     fi
223 223
 fi
224 224
 

+ 1
- 1
src/freedombone-rmemail 查看文件

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

+ 1
- 1
src/freedombone-rmlist 查看文件

@@ -40,7 +40,7 @@ LIST_ADDRESS=
40 40
 
41 41
 function show_help {
42 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 44
     echo ''
45 45
     exit 0
46 46
 }

+ 5
- 5
src/freedombone-rmsipuser 查看文件

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

+ 10
- 10
src/freedombone-rmuser 查看文件

@@ -9,40 +9,40 @@ MY_USERNAME=$1
9 9
 COMPLETION_FILE=$HOME/freedombone-completed.txt
10 10
 
11 11
 if [ ! $MY_USERNAME ]; then
12
-    echo 'Please specify a username to remove'
12
+    echo $'Please specify a username to remove'
13 13
     exit 1
14 14
 fi
15 15
 
16 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 18
     exit 2
19 19
 fi
20 20
 
21 21
 if [ ! -f $COMPLETION_FILE ]; then
22
-    echo "$COMPLETION_FILE not found"
22
+    echo $"$COMPLETION_FILE not found"
23 23
     exit 3
24 24
 fi
25 25
 
26 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 28
     exit 4
29 29
 fi
30 30
 
31 31
 ADMIN_USERNAME=$(cat $COMPLETION_FILE | grep "Admin user" | awk -F ':' '{print $2}')
32 32
 if [ ! $ADMIN_USERNAME ]; then
33
-    echo "No admin username specified in $COMPLETION_FILE"
33
+    echo $"No admin username specified in $COMPLETION_FILE"
34 34
     exit 5
35 35
 fi
36 36
 
37 37
 if [[ $MY_USERNAME == $ADMIN_USERNAME ]]; then
38
-    echo "The administrator user cannot be removed"
38
+    echo $"The administrator user cannot be removed"
39 39
     exit 6
40 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 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 46
     exit 7
47 47
 fi
48 48
 
@@ -71,6 +71,6 @@ if [ -d /home/$MY_USERNAME ]; then
71 71
     rm -rf /home/$MY_USERNAME
72 72
 fi
73 73
 
74
-echo "User $MY_USERNAME was removed"
74
+echo $"User $MY_USERNAME was removed"
75 75
 
76 76
 exit 0

+ 1
- 1
src/freedombone-rmxmpp 查看文件

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

+ 18
- 18
src/freedombone-sec 查看文件

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

+ 11
- 11
src/freedombone-splitkey 查看文件

@@ -46,7 +46,7 @@ MY_NAME=
46 46
 
47 47
 function show_help {
48 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 50
     echo ''
51 51
     exit 0
52 52
 }
@@ -86,12 +86,12 @@ if [ ! $MY_USERNAME ]; then
86 86
     show_help
87 87
 fi
88 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 90
     exit 7270
91 91
 fi
92 92
 
93 93
 if [ ! -d /home/$MY_USERNAME/.gnupg ]; then
94
-    echo 'No gpg key found'
94
+    echo $'No gpg key found'
95 95
     exit 5393
96 96
 fi
97 97
 
@@ -107,7 +107,7 @@ fi
107 107
 KEYID=$(su -c "gpg --list-keys $MY_EMAIL_ADDRESS | grep 'pub '" - \
108 108
            $MY_USERNAME | awk -F ' ' '{print $2}' | awk -F '/' '{print $2}')
109 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 111
     return 3682
112 112
 fi
113 113
 
@@ -115,7 +115,7 @@ MY_BACKUP_KEY_ID=$(gpg --list-keys "$MY_NAME (backup key)" | \
115 115
                           grep 'pub ' | awk -F ' ' '{print $2}' | \
116 116
                           awk -F '/' '{print $2}')
117 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 119
     return 58213
120 120
 fi
121 121
 
@@ -124,25 +124,25 @@ mkdir -p $FRAGMENTS_DIR
124 124
 KEYS_FILE=$FRAGMENTS_DIR/keyshare.asc
125 125
 gpg --output $FRAGMENTS_DIR/pubkey.txt --armor --export $KEYID
126 126
 if [ ! "$?" = "0" ]; then
127
-    echo "Unable to extract public key for $KEYID"
127
+    echo $"Unable to extract public key for $KEYID"
128 128
     exit 7835
129 129
 fi
130 130
 gpg --output $FRAGMENTS_DIR/privkey.txt \
131 131
     --armor --export-secret-key $KEYID
132 132
 if [ ! "$?" = "0" ]; then
133
-    echo "Unable to extract private key for $KEYID"
133
+    echo $"Unable to extract private key for $KEYID"
134 134
     exit 7823
135 135
 fi
136 136
 gpg --output $FRAGMENTS_DIR/backup_pubkey.txt \
137 137
     --armor --export $MY_BACKUP_KEY_ID
138 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 140
     exit 62928
141 141
 fi
142 142
 gpg --output $FRAGMENTS_DIR/backup_privkey.txt \
143 143
     --armor --export-secret-key $MY_BACKUP_KEY_ID
144 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 146
     exit 13783
147 147
 fi
148 148
 
@@ -158,7 +158,7 @@ shred -zu $FRAGMENTS_DIR/backup_pubkey.txt
158 158
 KEY_SHARES=$((KEY_FRAGMENTS * 2))
159 159
 gfsplit -n $KEY_FRAGMENTS -m $KEY_SHARES $KEYS_FILE
160 160
 if [ ! "$?" = "0" ]; then
161
-    echo "Unable to split the gpg key"
161
+    echo $"Unable to split the gpg key"
162 162
     rm -rf $FRAGMENTS_DIR
163 163
     if [ -f $KEYS_FILE ]; then
164 164
         shred -zu $KEYS_FILE
@@ -171,6 +171,6 @@ shred -zu $KEYS_FILE
171 171
 chown -R $MY_USERNAME:$MY_USERNAME $FRAGMENTS_DIR
172 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 176
 exit 0

+ 1
- 1
src/freedombone-unignore 查看文件

@@ -41,7 +41,7 @@ SUBJECT_TEXT=
41 41
 
42 42
 function show_help {
43 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 45
     echo ''
46 46
     exit 0
47 47
 }

+ 1
- 1
src/freedombone-xmpp-pass 查看文件

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