From ef9fcb946dafc36e15b06664ef53b049f4f65f83 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 27 Nov 2015 15:29:43 +0000 Subject: [PATCH] Preparing for international strings --- src/freedombone | 76 ++++++++++++++-------------- src/freedombone-addcert | 36 ++++++------- src/freedombone-addemail | 2 +- src/freedombone-addsipuser | 10 ++-- src/freedombone-adduser | 60 +++++++++++----------- src/freedombone-addxmpp | 4 +- src/freedombone-client | 8 +-- src/freedombone-clientcert | 22 ++++---- src/freedombone-format | 14 ++--- src/freedombone-ignore | 2 +- src/freedombone-image | 20 ++++---- src/freedombone-image-customise | 18 +++---- src/freedombone-image-hardware-setup | 2 +- src/freedombone-image-make | 8 +-- src/freedombone-keydrive | 38 +++++++------- src/freedombone-mesh | 54 ++++++++++---------- src/freedombone-meshweb | 72 +++++++++++++------------- src/freedombone-prep | 58 ++++++++++----------- src/freedombone-recoverkey | 30 +++++------ src/freedombone-remote | 28 +++++----- src/freedombone-renew-cert | 52 +++++++++---------- src/freedombone-rmemail | 2 +- src/freedombone-rmlist | 2 +- src/freedombone-rmsipuser | 10 ++-- src/freedombone-rmuser | 20 ++++---- src/freedombone-rmxmpp | 2 +- src/freedombone-sec | 36 ++++++------- src/freedombone-splitkey | 22 ++++---- src/freedombone-unignore | 2 +- src/freedombone-xmpp-pass | 2 +- 30 files changed, 356 insertions(+), 356 deletions(-) diff --git a/src/freedombone b/src/freedombone index 313c640b..dff2ba3b 100755 --- a/src/freedombone +++ b/src/freedombone @@ -461,49 +461,49 @@ LETSENCRYPT_SERVER='https://acme-v01.api.letsencrypt.org/directory' function show_help { echo '' - echo 'freedombone -c [configuration file]' + echo $'freedombone -c [configuration file]' echo '' - echo ' -h --help Show help' - echo ' menuconfig Easy interactive installation' - echo ' -c --config Installing from a configuration file' - echo ' --bbb Installing on Beaglebone Black' - echo ' -u --user User to install the system as' - echo ' -d --domain Default domain name' - echo ' -s --system System type' - echo ' --ip Static LAN IP address of the system' - echo ' --iprouter LAN IP address of the internet router' - echo ' --ddns Dynamic DNS provider domain' - echo ' --ddnsuser Dynamic DNS provider username' - echo ' --ddnspass Dynamic DNS provider password' + echo $' -h --help Show help' + echo $' menuconfig Easy interactive installation' + echo $' -c --config Installing from a configuration file' + echo $' --bbb Installing on Beaglebone Black' + echo $' -u --user User to install the system as' + echo $' -d --domain Default domain name' + echo $' -s --system System type' + echo $' --ip Static LAN IP address of the system' + echo $' --iprouter LAN IP address of the internet router' + echo $' --ddns Dynamic DNS provider domain' + echo $' --ddnsuser Dynamic DNS provider username' + echo $' --ddnspass Dynamic DNS provider password' echo '' - echo ' --microblogdomain Microblog domain name' - echo ' --wikidomain Wiki domain name' - echo ' --blogdomain Blog domain name' - echo ' --ownclouddomain Owncloud domain name' - echo ' --hubzilladomain Hubzilla domain name' - echo ' --gitdomain Git hosting domain name' - echo ' -t --time Domain used as a TLS time source' - echo ' --ssh ssh port number' - echo ' --list Public mailing list name' - echo ' --cores Number of CPU cores' - echo ' --name Your name' - echo ' --email Your email address' - echo ' --usb Path for the USB drive (eg. /dev/sdb1)' - echo ' --cjdns Enable CJDNS' - echo ' --vpass VoIP server password' - echo ' --vport VoIP server port' - echo ' --ns1 First DNS nameserver' - echo ' --ns2 Second DNS nameserver' - echo ' --repo Debian repository' + echo $' --microblogdomain Microblog domain name' + echo $' --wikidomain Wiki domain name' + echo $' --blogdomain Blog domain name' + echo $' --ownclouddomain Owncloud domain name' + echo $' --hubzilladomain Hubzilla domain name' + echo $' --gitdomain Git hosting domain name' + echo $' -t --time Domain used as a TLS time source' + echo $' --ssh ssh port number' + echo $' --list Public mailing list name' + echo $' --cores Number of CPU cores' + echo $' --name Your name' + echo $' --email Your email address' + echo $' --usb Path for the USB drive (eg. /dev/sdb1)' + echo $' --cjdns Enable CJDNS' + echo $' --vpass VoIP server password' + echo $' --vport VoIP server port' + echo $' --ns1 First DNS nameserver' + echo $' --ns2 Second DNS nameserver' + echo $' --repo Debian repository' echo '' - echo 'system types' + echo $'system types' echo '------------' - echo 'This can either be blank if you wish to install the full system,' - echo "or for more specialised variants you can specify '$VARIANT_MAILBOX', '$VARIANT_CLOUD'," - echo "'$VARIANT_CHAT', '$VARIANT_SOCIAL', '$VARIANT_MEDIA', '$VARIANT_WRITER', '$VARIANT_DEVELOPER'" - echo "or '$VARIANT_MESH'." + echo $'This can either be blank if you wish to install the full system,' + echo $"or for more specialised variants you can specify '$VARIANT_MAILBOX', '$VARIANT_CLOUD'," + echo $"'$VARIANT_CHAT', '$VARIANT_SOCIAL', '$VARIANT_MEDIA', '$VARIANT_WRITER', '$VARIANT_DEVELOPER'" + echo $"or '$VARIANT_MESH'." echo '' - echo "If you wish to install everything except email then use the '$VARIANT_NONMAILBOX' variaint." + echo $"If you wish to install everything except email then use the '$VARIANT_NONMAILBOX' variaint." echo '' exit 0 } diff --git a/src/freedombone-addcert b/src/freedombone-addcert index 8d3c705d..792aae04 100755 --- a/src/freedombone-addcert +++ b/src/freedombone-addcert @@ -48,23 +48,23 @@ LETSENCRYPT_SERVER='https://acme-v01.api.letsencrypt.org/directory' function show_help { echo '' - echo 'freedombone-addcert -h [hostname] -c [country code] -a [area] -l [location]' - echo ' -o [organisation] -u [unit] --ca "" --nodh ""' + echo $'freedombone-addcert -h [hostname] -c [country code] -a [area] -l [location]' + echo $' -o [organisation] -u [unit] --ca "" --nodh ""' echo '' - echo 'Creates a self-signed certificate for the given hostname' + echo $'Creates a self-signed certificate for the given hostname' echo '' - echo ' --help Show help' - echo ' -h --hostname [name] Hostname' - echo ' -e --letsencrypt [hostname] Hostname to use with Lets Encrypt' - echo ' -s --server [url] Lets Encrypt server URL' - echo ' -c --country [code] Optional country code (eg. US, GB, etc)' - echo ' -a --area [description] Optional area description' - echo ' -l --location [locn] Optional location name' - echo ' -o --organisation [name] Optional organisation name' - echo ' -u --unit [name] Optional unit name' - echo ' --dhkey [bits] DH key length in bits' - echo ' --nodh "" Do not calculate DH params' - echo ' --ca "" Certificate authority cert' + echo $' --help Show help' + echo $' -h --hostname [name] Hostname' + echo $' -e --letsencrypt [hostname] Hostname to use with Lets Encrypt' + echo $' -s --server [url] Lets Encrypt server URL' + echo $' -c --country [code] Optional country code (eg. US, GB, etc)' + echo $' -a --area [description] Optional area description' + echo $' -l --location [locn] Optional location name' + echo $' -o --organisation [name] Optional organisation name' + echo $' -u --unit [name] Optional unit name' + echo $' --dhkey [bits] DH key length in bits' + echo $' --nodh "" Do not calculate DH params' + echo $' --ca "" Certificate authority cert' echo '' exit 0 } @@ -131,13 +131,13 @@ done if [ ! $HOSTNAME ]; then if [ ! $LETSENCRYPT_HOSTNAME ]; then - echo 'No hostname specified' + echo $'No hostname specified' exit 5748 fi fi if ! which openssl > /dev/null ;then - echo "$0: openssl is not installed, exiting" 1>&2 + echo $"$0: openssl is not installed, exiting" 1>&2 exit 5689 fi @@ -169,7 +169,7 @@ if [ $LETSENCRYPT_HOSTNAME ]; then # TODO this requires user interaction - is there a non-interactive mode? ./letsencrypt-auto certonly --server $LETSENCRYPT_SERVER --standalone -d $LETSENCRYPT_HOSTNAME if [ ! "$?" = "0" ]; then - echo "Failed to install letsencrypt for domain $LETSENCRYPT_HOSTNAME" + echo $"Failed to install letsencrypt for domain $LETSENCRYPT_HOSTNAME" exit 63216 fi diff --git a/src/freedombone-addemail b/src/freedombone-addemail index e2efa602..4b2c7c4e 100755 --- a/src/freedombone-addemail +++ b/src/freedombone-addemail @@ -40,7 +40,7 @@ GROUP_NAME= function show_help { echo '' - echo 'freedombone-addemail -u [username] -e [email address] -g [group name]' + echo $'freedombone-addemail -u [username] -e [email address] -g [group name]' echo '' exit 0 } diff --git a/src/freedombone-addsipuser b/src/freedombone-addsipuser index 391d97d0..2a8e6275 100755 --- a/src/freedombone-addsipuser +++ b/src/freedombone-addsipuser @@ -42,7 +42,7 @@ USER_EXISTS="no" function show_help { echo '' - echo 'freedombone-addsipuser -u [username] -e [extension] -p [password]' + echo $'freedombone-addsipuser -u [username] -e [extension] -p [password]' echo '' exit 0 } @@ -140,13 +140,13 @@ if ! [[ $MY_USERNAME && $EXTENSION && $PASSWORD ]]; then fi if [ ! -f $CONFIG_FILE ]; then - echo "SIP configuration file not found" + echo $"SIP configuration file not found" exit 1 fi # the user must already exist on the system if [ ! -d /home/$MY_USERNAME ]; then - echo "User $MY_USERNAME not found" + echo $"User $MY_USERNAME not found" exit 2 fi @@ -154,10 +154,10 @@ sip_user_exists if [[ $USER_EXISTS == "yes" ]]; then update_sip_user - echo "SIP user $MY_USERNAME amended" + echo $"SIP user $MY_USERNAME amended" else add_sip_user - echo "SIP user $MY_USERNAME added" + echo $"SIP user $MY_USERNAME added" fi systemctl restart sipwitch diff --git a/src/freedombone-adduser b/src/freedombone-adduser index 646a0bd3..6d6f920d 100755 --- a/src/freedombone-adduser +++ b/src/freedombone-adduser @@ -43,17 +43,17 @@ SIP_EXTENSION= FULLBLOG_DOMAIN_NAME= if [ ! $MY_USERNAME ]; then - echo 'No username was given' + echo $'No username was given' exit 1 fi if [ -d /home/$MY_USERNAME ]; then - echo "The user $MY_USERNAME already exists" + echo $"The user $MY_USERNAME already exists" exit 2 fi if [ ! -f $COMPLETION_FILE ]; then - echo "$COMPLETION_FILE not found" + echo $"$COMPLETION_FILE not found" userdel -r $MY_USERNAME exit 3 fi @@ -63,7 +63,7 @@ useradd -m -p "$NEW_USER_PASSWORD" -s /bin/bash $MY_USERNAME adduser $MY_USERNAME sasl if [ ! -d /home/$MY_USERNAME ]; then - echo 'Home directory was not created' + echo $'Home directory was not created' exit 4 fi @@ -73,15 +73,15 @@ if [ "$SSH_PUBLIC_KEY" ]; then mkdir /home/$MY_USERNAME/.ssh cp $SSH_PUBLIC_KEY /home/$MY_USERNAME/.ssh/authorized_keys chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.ssh - echo 'ssh public key installed' + echo $'ssh public key installed' else if [[ "$SSH_PUBLIC_KEY" == "ssh-"* ]]; then mkdir /home/$MY_USERNAME/.ssh echo "$SSH_PUBLIC_KEY" > /home/$MY_USERNAME/.ssh/authorized_keys chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.ssh - echo 'ssh public key installed' + echo $'ssh public key installed' else - echo 'The second parameter does not look like an ssh key' + echo $'The second parameter does not look like an ssh key' exit 5 fi fi @@ -89,7 +89,7 @@ if [ "$SSH_PUBLIC_KEY" ]; then fi if [ ! -d /home/$MY_USERNAME/Maildir ]; then - echo 'Email directory was not created' + echo $'Email directory was not created' userdel -r $MY_USERNAME exit 6 fi @@ -142,7 +142,7 @@ fi # encrypt outgoing mail to the "sent" folder if ! grep -q "pgp_encrypt_only_command" /home/$MY_USERNAME/.muttrc; then echo '' >> /home/$MY_USERNAME/.muttrc - echo '# Encrypt items in the Sent folder' >> /home/$MY_USERNAME/.muttrc + echo $'# Encrypt items in the Sent folder' >> /home/$MY_USERNAME/.muttrc 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 else 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 if ! grep -q "Change your GPG password" /home/$MY_USERNAME/README; then echo '' >> /home/$MY_USERNAME/README echo '' >> /home/$MY_USERNAME/README - echo 'Change your GPG password' >> /home/$MY_USERNAME/README + echo $'Change your GPG password' >> /home/$MY_USERNAME/README echo '========================' >> /home/$MY_USERNAME/README - echo "It's very important to add a password to your GPG key so that" >> /home/$MY_USERNAME/README - echo "if anyone does get access to your email they still won't be able" >> /home/$MY_USERNAME/README - echo 'to read them without knowning the GPG password.' >> /home/$MY_USERNAME/README - echo 'You can change the it with:' >> /home/$MY_USERNAME/README + echo $"It's very important to add a password to your GPG key so that" >> /home/$MY_USERNAME/README + echo $"if anyone does get access to your email they still won't be able" >> /home/$MY_USERNAME/README + echo $'to read them without knowning the GPG password.' >> /home/$MY_USERNAME/README + echo $'You can change the it with:' >> /home/$MY_USERNAME/README echo '' >> /home/$MY_USERNAME/README echo " gpg --edit-key $MY_GPG_PUBLIC_KEY_ID" >> /home/$MY_USERNAME/README echo ' passwd' >> /home/$MY_USERNAME/README @@ -173,10 +173,10 @@ fi if ! grep -q "Publish your GPG public key" /home/$MY_USERNAME/README; then echo '' >> /home/$MY_USERNAME/README echo '' >> /home/$MY_USERNAME/README - echo 'Publish your GPG public key' >> /home/$MY_USERNAME/README + echo $'Publish your GPG public key' >> /home/$MY_USERNAME/README echo '===========================' >> /home/$MY_USERNAME/README - echo 'So that others can send emails to you securely you should' >> /home/$MY_USERNAME/README - echo 'publish your GPG public key with the command:' >> /home/$MY_USERNAME/README + echo $'So that others can send emails to you securely you should' >> /home/$MY_USERNAME/README + echo $'publish your GPG public key with the command:' >> /home/$MY_USERNAME/README echo '' >> /home/$MY_USERNAME/README echo " gpg --send-keys $MY_GPG_PUBLIC_KEY_ID" >> /home/$MY_USERNAME/README fi @@ -186,10 +186,10 @@ chown $MY_USERNAME:$MY_USERNAME $MY_GPG_PUBLIC_KEY chmod 600 /home/$MY_USERNAME/README if grep -q "install_xmpp" $COMPLETION_FILE; then - echo "Adding an XMPP account for $MY_USERNAME" + echo $"Adding an XMPP account for $MY_USERNAME" freedombone-addxmpp -e "$MY_USERNAME@$HOSTNAME" -p "$NEW_USER_PASSWORD" if [ ! "$?" = "0" ]; then - echo "XMPP account not created" + echo $"XMPP account not created" userdel -r $MY_USERNAME exit 8 fi @@ -198,7 +198,7 @@ fi if grep -q "Blog domain" $COMPLETION_FILE; then FULLBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Blog domain" | awk -F ':' '{print $2}') if [ ! -d /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/users ]; then - echo 'Blog users directory not found' + echo $'Blog users directory not found' if grep -q "install_xmpp" $COMPLETION_FILE; then freedombone-rmxmpp -e "$MY_USERNAME@$HOSTNAME" fi @@ -217,7 +217,7 @@ if grep -q "install_sip" $COMPLETION_FILE; then SIP_EXTENSION=$(freedombone-sipfreeext) freedombone-addsipuser -u $MY_USERNAME -e $SIP_EXTENSION -p "$NEW_USER_PASSWORD" if [ ! "$?" = "0" ]; then - echo 'SIP user could not be added. Ensure that extension numbers are in order and do no exceed 299' + echo $'SIP user could not be added. Ensure that extension numbers are in order and do no exceed 299' if grep -q "install_xmpp" $COMPLETION_FILE; then freedombone-rmxmpp -e "$MY_USERNAME@$HOSTNAME" fi @@ -255,21 +255,21 @@ fi #fi clear -echo "New user $MY_USERNAME was created" +echo $"New user $MY_USERNAME was created" if [ $SIP_EXTENSION ]; then - echo "Their SIP phone extension is $SIP_EXTENSION" + echo $"Their SIP phone extension is $SIP_EXTENSION" fi -echo "Their login password is $NEW_USER_PASSWORD" +echo $"Their login password is $NEW_USER_PASSWORD" echo '' -echo 'IMPORTANT: Make a note of the password, because it will not be saved' -echo 'anywhere else. Preferably give it to them in person on paper or via' -echo 'a secure channel, not in an unencrypted email.' +echo $'IMPORTANT: Make a note of the password, because it will not be saved' +echo $'anywhere else. Preferably give it to them in person on paper or via' +echo $'a secure channel, not in an unencrypted email.' echo '' -echo "They can download their GPG keys with:" +echo $"They can download their GPG keys with:" echo '' echo " scp -P $SSH_PORT -r $MY_USERNAME@$HOSTNAME:/home/$MY_USERNAME/.gnupg ~/" echo '' -echo 'They should also run freedombone-client on their system to ensure' -echo 'the best security.' +echo $'They should also run freedombone-client on their system to ensure' +echo $'the best security.' exit 0 diff --git a/src/freedombone-addxmpp b/src/freedombone-addxmpp index b7ac1252..c9ad355f 100755 --- a/src/freedombone-addxmpp +++ b/src/freedombone-addxmpp @@ -39,7 +39,7 @@ NEW_USER_PASSWORD= function show_help { echo '' - echo 'freedombone-addxmpp -e [email address] -p [password]' + echo $'freedombone-addxmpp -e [email address] -p [password]' echo '' exit 0 } @@ -68,7 +68,7 @@ shift done if [ ! -d /etc/prosody ]; then - echo 'xmpp server is not installed' + echo $'xmpp server is not installed' exit 0 fi diff --git a/src/freedombone-client b/src/freedombone-client index 24c0f81b..b5bb2927 100755 --- a/src/freedombone-client +++ b/src/freedombone-client @@ -103,7 +103,7 @@ function configure_ssh_client { ssh_remove_small_moduli echo '' - echo 'Copy the following into a file called /home/username/.ssh/authorized_keys on the Freedombone server' + echo $'Copy the following into a file called /home/username/.ssh/authorized_keys on the Freedombone server' echo '' echo $(cat /home/$CURR_USER/.ssh/id_rsa.pub) echo $(cat /home/$CURR_USER/.ssh/id_ed25519.pub) @@ -477,7 +477,7 @@ function mesh_batman { function show_help { echo '' - echo 'freedombone-client' + echo $'freedombone-client' echo '' exit 0 } @@ -505,9 +505,9 @@ esac shift done -echo 'Configuring client' +echo $'Configuring client' configure_ssh_client mesh_batman mesh_babel -echo 'Configuration complete' +echo $'Configuration complete' exit 0 diff --git a/src/freedombone-clientcert b/src/freedombone-clientcert index 3d94272c..2528c6b9 100755 --- a/src/freedombone-clientcert +++ b/src/freedombone-clientcert @@ -47,12 +47,12 @@ EXTENSIONS="" function show_help { echo '' - echo 'freedombone-clientcert -u [username]' + echo $'freedombone-clientcert -u [username]' echo '' - echo 'Creates email certificates for use with IMAP clients' + echo $'Creates email certificates for use with IMAP clients' echo '' - echo ' --help Show help' - echo ' -u --username [name] Username' + echo $' --help Show help' + echo $' -u --username [name] Username' echo '' exit 0 } @@ -77,17 +77,17 @@ shift done if [ ! $USERNAME ]; then - echo 'No username specified' + echo $'No username specified' exit 5748 fi if [ ! -d /home/$USERNAME ]; then - echo "User $USERNAME not found" + echo $"User $USERNAME not found" exit 76239 fi if [ -d /home/$USERNAME/emailcert ]; then - echo 'Client certs were already for created' + echo $'Client certs were already for created' exit 2953 fi @@ -106,7 +106,7 @@ chmod 600 /etc/dovecot/passwd-file freedombone-addcert -h $USERNAME --nodh "" if [ ! -f /etc/ssl/private/$USERNAME.key ]; then - echo 'User certificates were not created' + echo $'User certificates were not created' rm -rf /home/$USERNAME/emailcert exit 74835 fi @@ -118,7 +118,7 @@ openssl req -new -sha256 -subj \ -out /etc/ssl/requests/$USERNAME.csr if [ ! -f /etc/ssl/requests/$USERNAME.csr ]; then - echo 'Certificate request was not created' + echo $'Certificate request was not created' rm -rf /home/$USERNAME/emailcert exit 83520 fi @@ -130,7 +130,7 @@ openssl ca -config /etc/ssl/dovecot-ca.cnf \ -out /etc/ssl/certs/$USERNAME.cer if [ ! -f /etc/ssl/certs/$USERNAME.cer ]; then - echo 'Authentication certificate was not created' + echo $'Authentication certificate was not created' rm -rf /home/$USERNAME/emailcert exit 343569 fi @@ -167,7 +167,7 @@ chmod +x /home/$USERNAME/emailcert/install.sh shred -zu /etc/ssl/requests/$USERNAME.csr -echo 'Email authentication certificate created. You can obtain it on the client with:' +echo $'Email authentication certificate created. You can obtain it on the client with:' echo '' echo " scp -P 2222 -r $USERNAME@$HOSTNAME:/home/$USERNAME/emailcert ~/" echo '' diff --git a/src/freedombone-format b/src/freedombone-format index 1830ef62..514c1da0 100755 --- a/src/freedombone-format +++ b/src/freedombone-format @@ -34,14 +34,14 @@ export TEXTDOMAIN=$PROJECT_NAME export TEXTDOMAINDIR="/usr/share/locale" if [ ! $1 ]; then - echo 'Specify a drive, such as sdb, sdc, etc' + echo $'Specify a drive, such as sdb, sdc, etc' exit 1 fi USB_DRIVE=/dev/${1}1 LABEL='Freedombone' -echo 'Partitioning drive' +echo $'Partitioning drive' echo "o d 2 @@ -57,21 +57,21 @@ a w " | fdisk /dev/${1};mkfs.ext4 -L "$LABEL" /dev/${1}1 -echo "Formatting $USB_DRIVE as LUKS" +echo $"Formatting $USB_DRIVE as LUKS" cryptsetup -y -v luksFormat ${USB_DRIVE} if [ ! "$?" = "0" ]; then - echo "Failed to format $USB_DRIVE as LUKS" + echo $"Failed to format $USB_DRIVE as LUKS" exit 36823 fi cryptsetup luksOpen ${USB_DRIVE} encrypted_usb if [ ! "$?" = "0" ]; then - echo "Failed to open LUKS formatted drive $USB_DRIVE" + echo $"Failed to open LUKS formatted drive $USB_DRIVE" exit 37232 fi mkfs.ext4 /dev/mapper/encrypted_usb -L Freedombone if [ ! "$?" = "0" ]; then cryptsetup luksClose encrypted_usb - echo 'Format of drive $USB_DRIVE failed' + echo $'Format of drive $USB_DRIVE failed' exit 73218 fi sleep 2 @@ -79,5 +79,5 @@ cryptsetup luksClose encrypted_usb if [ -f /dev/mapper/encrypted_usb ]; then rm -rf /dev/mapper/encrypted_usb fi -echo 'Format completed' +echo $'Format completed' exit 0 diff --git a/src/freedombone-ignore b/src/freedombone-ignore index 83dd040e..b2079e21 100755 --- a/src/freedombone-ignore +++ b/src/freedombone-ignore @@ -41,7 +41,7 @@ SUBJECT_TEXT= function show_help { echo '' - echo 'freedombone-ignore -u [username] -e [mail address] -t [text in subject line]' + echo $'freedombone-ignore -u [username] -e [mail address] -t [text in subject line]' echo '' exit 0 } diff --git a/src/freedombone-image b/src/freedombone-image index fb8f7d7f..6e1bedb7 100755 --- a/src/freedombone-image +++ b/src/freedombone-image @@ -84,7 +84,7 @@ case $key in shift CONFIG_FILENAME="$1" if [ ! -f $CONFIG_FILENAME ]; then - echo "Config file $CONFIG_FILENAME not found" + echo $"Config file $CONFIG_FILENAME not found" exit 3 fi DEFAULT_DOMAIN_NAME=$(cat $CONFIG_FILENAME | grep 'DEFAULT_DOMAIN_NAME' | awk -F '=' '{print $2}') @@ -101,7 +101,7 @@ case $key in shift PASSWORD="$1" if [ ${#PASSWORD} -lt $MINIMUM_PASSWORD_LENGTH ]; then - echo "Your password chould contain at least ${MINIMUM_PASSWORD_LENGTH} characters" + echo $"Your password chould contain at least ${MINIMUM_PASSWORD_LENGTH} characters" exit 3628 fi ;; @@ -201,7 +201,7 @@ make $IMAGE_TYPE \ GENERIC_IMAGE="$GENERIC_IMAGE" if [ ! "$?" = "0" ]; then - echo 'Build failed' + echo $'Build failed' rm -rf $BUILD_DIR exit 1 fi @@ -217,7 +217,7 @@ fi shopt -s nullglob imgfiles=(build/${PROJECT_NAME}*.${EXPECTED_EXTENSION}) if [ ${#imgfiles[@]} -eq 0 ]; then - echo 'Image was not created' + echo $'Image was not created' rm -rf $BUILD_DIR exit 2 fi @@ -232,19 +232,19 @@ rm -rf ${BUILD_DIR} cd ${CURR_DIR} clear -echo " +echo $" Image was created. You will be able to log into it with: " if [[ $IMAGE_TYPE != "virtualbox"* && $IMAGE_TYPE != "qemu"* ]]; then - echo " ssh $USERNAME@$DEFAULT_DOMAIN_NAME -p 2222 + echo $" ssh $USERNAME@$DEFAULT_DOMAIN_NAME -p 2222 Password: $PASSWORD " else if [[ $IMAGE_TYPE != "qemu"* ]]; then - echo " Username: $USERNAME + echo $" Username: $USERNAME Password: $PASSWORD " else @@ -253,7 +253,7 @@ else else echo "qemu-system-x86_64 $(ls ${PROJECT_NAME}*.qcow2)" fi - echo " + echo $" Username: $USERNAME Password: $PASSWORD " @@ -262,13 +262,13 @@ fi ls -lh ${PROJECT_NAME}*.img ${PROJECT_NAME}*.sig ${PROJECT_NAME}*.bz2 ${PROJECT_NAME}*.vdi ${PROJECT_NAME}*.qcow2 # record the default login credentials for later use -echo "Username: $USERNAME +echo $"Username: $USERNAME Password: $PASSWORD" > ${CURR_DIR}/${PROJECT_NAME}_login_credentials.txt chmod 600 ${CURR_DIR}/${PROJECT_NAME}_login_credentials.txt if [[ $IMAGE_TYPE != "virtualbox"* && $IMAGE_TYPE != "qemu"* ]]; then echo '' - echo 'You can copy the image to a microSD card with:' + echo $'You can copy the image to a microSD card with:' echo '' echo " sudo dd bs=1M if=$(ls ${PROJECT_NAME}*.img) of=/dev/sdX conv=fdatasync" echo '' diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise index 58c531ce..b1344c8b 100755 --- a/src/freedombone-image-customise +++ b/src/freedombone-image-customise @@ -60,7 +60,7 @@ enable_eatmydata_override() { chroot $rootdir apt-get install --no-install-recommends -y eatmydata if [ -x $rootdir/usr/bin/eatmydata ] && \ [ ! -f $rootdir/etc/apt/apt.conf.d/95debian-edu-install-dpkg-eatmydata ]; then - echo "info: Adding apt config to call dpkg via eatmydata" + echo $"info: Adding apt config to call dpkg via eatmydata" printf "#!/bin/sh\nexec eatmydata dpkg \"\$@\"\n" \ > $rootdir/var/tmp/dpkg-eatmydata chmod 755 $rootdir/var/tmp/dpkg-eatmydata @@ -68,7 +68,7 @@ enable_eatmydata_override() { Dir::Bin::dpkg "/var/tmp/dpkg-eatmydata"; EOF else - echo "error: unable to find /usr/bin/eatmydata after installing the eatmydata package" + echo $"error: unable to find /usr/bin/eatmydata after installing the eatmydata package" fi } @@ -76,11 +76,11 @@ disable_eatmydata_override() { for override in \ /etc/apt/apt.conf.d/95debian-edu-install-dpkg-eatmydata \ /var/tmp/dpkg-eatmydata ; do - echo "info: Removing apt config to call dpkg via eatmydata" + echo $"info: Removing apt config to call dpkg via eatmydata" if [ -f $rootdir$override ] ; then rm -f $rootdir$override else - echo "warning: missing $rootdir$override" + echo $"warning: missing $rootdir$override" fi done sync # Flush file buffers before continuing @@ -151,7 +151,7 @@ iface eth0 inet static sed -i "/nameserver $NAMESERVER1/a\nameserver $NAMESERVER2" $rootdir/etc/resolv.conf # change the motd to show further install instructions - echo " + echo $" .---. . . | | | |--- .--. .-. .-. .-.| .-. .--.--. |.-. .-. .--. .-. @@ -179,9 +179,9 @@ configure_ssh() { echo "$SSH_PUBKEY" > $rootdir/home/$MY_USERNAME/.ssh/authorized_keys chroot $rootdir chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.ssh sed -i 's|PasswordAuthentication.*|PasswordAuthentication no|g' $rootdir/etc/ssh/sshd_config - echo "Using ssh public key:" + echo $"Using ssh public key:" echo $SSH_PUBKEY - echo 'Password ssh authentication turned off' + echo $'Password ssh authentication turned off' fi } @@ -300,7 +300,7 @@ export LC_ALL=C LANGUAGE=C LANG=C export TMP=/tmp/ TMPDIR=/tmp/ username=$MY_USERNAME -echo "warning: creating initial user $username with well known password!" +echo $"warning: creating initial user $username with well known password!" password=$MY_PASSWORD chroot "$rootdir" adduser --gecos $username --disabled-password $username echo $username:$password | chroot $rootdir /usr/sbin/chpasswd @@ -389,5 +389,5 @@ create_generic_image continue_installation cd / -echo "info: killing leftover processes in chroot" +echo $"info: killing leftover processes in chroot" fuser -mvk $rootdir/. || true diff --git a/src/freedombone-image-hardware-setup b/src/freedombone-image-hardware-setup index f51a50fc..16418b1b 100755 --- a/src/freedombone-image-hardware-setup +++ b/src/freedombone-image-hardware-setup @@ -34,7 +34,7 @@ export TEXTDOMAINDIR="/usr/share/locale" enable_serial_console() { # By default, spawn a console on the serial port device="$1" - echo "Adding a getty on the serial port" + echo $"Adding a getty on the serial port" echo "T0:12345:respawn:/sbin/getty -L $device 115200 vt100" >> /etc/inittab } diff --git a/src/freedombone-image-make b/src/freedombone-image-make index 2eefc1b8..f2e5a996 100755 --- a/src/freedombone-image-make +++ b/src/freedombone-image-make @@ -58,7 +58,7 @@ vendor_dir="${basedir}/vendor" vmdebootstrap_dir="${vendor_dir}/vmdebootstrap" if [ -z "$MIRROR" ] || [ -z "$SUITE" ] ; then - echo error: Missing MIRROR and SUITE settings inherited from Makefile. + echo $"error: Missing MIRROR and SUITE settings inherited from Makefile." exit 1 fi @@ -145,7 +145,7 @@ else VMDEBOOTSTRAP=vmdebootstrap fi -echo 'Making customised customisation script' +echo $'Making customised customisation script' TEMP_CUSTOMISE=/etc/${PROJECT_NAME}/image-customise if [ -f /usr/local/bin/${PROJECT_NAME}-image-customise ]; then 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 sudo sed -i "s|SSH_PUBKEY=.*|SSH_PUBKEY=${SSH_PUBKEY}|g" $TEMP_CUSTOMISE sudo sed -i "s|GENERIC_IMAGE=.*|GENERIC_IMAGE=${GENERIC_IMAGE}|g" $TEMP_CUSTOMISE -echo "starting $VMDEBOOTSTRAP" +echo $"starting $VMDEBOOTSTRAP" # Run vmdebootstrap script to create image sudo -H \ SUITE="$SUITE" \ @@ -188,5 +188,5 @@ sudo -H \ $extra_opts \ $pkgopts -echo 'Removing customised customisation script' +echo $'Removing customised customisation script' sudo shred -zu $TEMP_CUSTOMISE diff --git a/src/freedombone-keydrive b/src/freedombone-keydrive index cecac59e..a21bf723 100755 --- a/src/freedombone-keydrive +++ b/src/freedombone-keydrive @@ -43,7 +43,7 @@ FORMAT="no" function show_help { echo '' - echo 'freedombone-keydrive -u [username] -d [device, eg. sdb] --master [yes/no] -n [no of fragments] --format [yes/no]' + echo $'freedombone-keydrive -u [username] -d [device, eg. sdb] --master [yes/no] -n [no of fragments] --format [yes/no]' echo '' exit 0 } @@ -84,17 +84,17 @@ shift done if [ ! $MY_USERNAME ]; then - echo 'No username given' + echo $'No username given' exit 69350 fi if [ ! -d /home/$MY_USERNAME ]; then - echo "Home directory for $MY_USERNAME not found. This user may not exist on the system" + echo $"Home directory for $MY_USERNAME not found. This user may not exist on the system" exit 72378 fi if [ ! -b $USB_DRIVE ]; then - echo 'Please attach a USB drive' + echo $'Please attach a USB drive' exit 65743 fi @@ -121,7 +121,7 @@ if [ "$?" = "0" ]; then fi mount $USB_DRIVE $USB_MOUNT if [ ! "$?" = "0" ]; then - echo "There was a problem mounting the USB drive to $USB_MOUNT" + echo $"There was a problem mounting the USB drive to $USB_MOUNT" rm -rf $USB_MOUNT exit 78543 fi @@ -129,16 +129,16 @@ fi # optionally create a master drive which contains the full GPG keyring if [[ $MASTER_DRIVE == "yes" || $MASTER_DRIVE == "y" || $MASTER_DRIVE == "1" ]]; then if [ ! -d /home/$MY_USERNAME/.gnupg ]; then - echo "No .gnupg directory was found for $MY_USERNAME" + echo $"No .gnupg directory was found for $MY_USERNAME" umount -f $USB_MOUNT rm -rf $USB_MOUNT exit 73025 fi cp -rf /home/$MY_USERNAME/.gnupg $USB_MOUNT if [ -d $USB_MOUNT/.gnupg ]; then - echo "GPG Keyring copied to $USB_DRIVE. You may now remove the drive." + echo $"GPG Keyring copied to $USB_DRIVE. You may now remove the drive." else - echo "Unable to copy gpg keyring to $USB_DRIVE" + echo $"Unable to copy gpg keyring to $USB_DRIVE" fi umount -f $USB_MOUNT rm -rf $USB_MOUNT @@ -147,8 +147,8 @@ fi # Don't use the USB drive if it already contains a full keyring if [ -d $USB_MOUNT/.gnupg ]; then - echo 'A full GPG keyring already exists on the USB drive.' - echo 'Either reformat the USB drive or use a different drive.' + echo $'A full GPG keyring already exists on the USB drive.' + echo $'Either reformat the USB drive or use a different drive.' umount -f $USB_MOUNT rm -rf $USB_MOUNT exit 3392 @@ -164,10 +164,10 @@ FRAGMENTS_DIR=$FRAGMENTS_DIR/$MY_USERNAME # make a directory to contain the fragments if [ ! -d $FRAGMENTS_DIR ]; then mkdir -p $FRAGMENTS_DIR - echo "Made directory $FRAGMENTS_DIR" + echo $"Made directory $FRAGMENTS_DIR" fi if [ ! -d $FRAGMENTS_DIR ]; then - echo "There was a problem making the directory $FRAGMENTS_DIR" + echo $"There was a problem making the directory $FRAGMENTS_DIR" umount -f $USB_MOUNT rm -rf $USB_MOUNT exit 6843 @@ -179,7 +179,7 @@ if [ ! "$?" = "0" ]; then no_of_usb_shares=0 fi if (( no_of_usb_shares > 0 )); then - echo "A key fragment already exists on the drive for the user $MY_USERNAME" + echo $"A key fragment already exists on the drive for the user $MY_USERNAME" cd ~/ umount -f $USB_MOUNT rm -rf $USB_MOUNT @@ -208,7 +208,7 @@ if (( no_of_local_shares < 3 )); then fi if (( no_of_local_shares < 3 )); then - echo "Not enough key fragments available ${no_of_local_shares}" + echo $"Not enough key fragments available ${no_of_local_shares}" cd ~/ umount -f $USB_MOUNT rm -rf $USB_MOUNT @@ -221,9 +221,9 @@ SHARE_FILENAME=${share_files[RANDOM % ${#share_files[@]}]} cp -f $SHARE_FILENAME $FRAGMENTS_DIR cd $FRAGMENTS_DIR no_of_usb_shares=$(ls -afq keyshare.asc.* | wc -l) -echo "Number of fragments on the drive: ${no_of_usb_shares}" +echo $"Number of fragments on the drive: ${no_of_usb_shares}" if (( no_of_usb_shares > 1 )); then - echo "Too many key fragments exist in $FRAGMENTS_DIR" + echo $"Too many key fragments exist in $FRAGMENTS_DIR" ls $FRAGMENTS_DIR cd ~/ umount -f $USB_MOUNT @@ -231,8 +231,8 @@ if (( no_of_usb_shares > 1 )); then exit 54292 fi if (( no_of_usb_shares <= 0 )); then - echo "There was a problem copying the key fragment to $USB_DRIVE" - echo "Files found: ${no_of_usb_shares}" + echo $"There was a problem copying the key fragment to $USB_DRIVE" + echo $"Files found: ${no_of_usb_shares}" ls $FRAGMENTS_DIR cd ~/ umount -f $USB_MOUNT @@ -243,6 +243,6 @@ fi cd ~/ umount -f $USB_MOUNT rm -rf $USB_MOUNT -echo "Key fragment copied to $USB_DRIVE. You may now remove the drive." +echo $"Key fragment copied to $USB_DRIVE. You may now remove the drive." exit 0 diff --git a/src/freedombone-mesh b/src/freedombone-mesh index f1dbbd20..a4b1174d 100755 --- a/src/freedombone-mesh +++ b/src/freedombone-mesh @@ -79,14 +79,14 @@ function install_toxcore { sudo cp /usr/local/lib/libtoxcore* /usr/lib/ if [ ! -f /usr/local/bin/tox-bootstrapd ]; then - echo "File not found /usr/local/bin/tox-bootstrapd" + echo $"File not found /usr/local/bin/tox-bootstrapd" exit 73862 fi 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 sudo chmod 700 /var/lib/tox-bootstrapd if [ ! -f ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.conf ]; then - echo "File not found $INSTALL_DIR/toxcore/other/bootstrap_daemon/tox-bootstrapd.conf" + echo $"File not found $INSTALL_DIR/toxcore/other/bootstrap_daemon/tox-bootstrapd.conf" exit 476835 fi @@ -106,7 +106,7 @@ function install_toxcore { if [ -f /bin/systemctl ]; then if [ ! -f ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service ]; then - echo "File not found ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service" + echo $"File not found ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service" exit 7359 fi sudo cp ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service /etc/systemd/system/ @@ -129,7 +129,7 @@ function install_toxcore { TOX_PUBLIC_KEY=$(cat /var/log/syslog | grep tox | grep "Public Key" | awk -F ' ' '{print $8}' | tail -1) if [ ${#TOX_PUBLIC_KEY} -lt 30 ]; then - echo 'Could not obtain the tox node public key' + echo $'Could not obtain the tox node public key' exit 6529 fi @@ -149,7 +149,7 @@ function install_toxid { sudo make install if [ ! -f /usr/local/bin/toxid ]; then - echo "Couldn't install toxid" + echo $"Couldn't install toxid" exit 6389 fi @@ -178,7 +178,7 @@ function run_tox { # get a list of peers PEER_TOX_ID_LIST=$(lstox | grep $AVAHI_DOMAIN | sort -u) if [ ! "$PEER_TOX_ID_LIST" ]; then - echo 'No peers found' + echo $'No peers found' exit 0 fi PEER_TOX_ID_LIST_COUNT=$(echo "$PEER_TOX_ID_LIST" | wc -l) @@ -189,7 +189,7 @@ function run_tox { else # choose a user from a list echo '' - echo "Select a user on $AVAHI_DOMAIN:" + echo $"Select a user on $AVAHI_DOMAIN:" ctr=0 while IFS='' read -r line || [[ -n "$line" ]]; do toxusername=$(echo $line | awk -F ' ' '{print $2}') @@ -204,7 +204,7 @@ function run_tox { if [ ${#PEER_TOX_ID} -gt 30 ]; then # start client and make a friend request if [ -f $QTOX_INI ]; then - echo 'Launch qTox' + echo $'Launch qTox' qtox & else @@ -220,7 +220,7 @@ function run_tox { else # ID was invalid echo $PEER_TOX_ID - echo "Tox ID for $AVAHI_DOMAIN was not found" + echo $"Tox ID for $AVAHI_DOMAIN was not found" exit 6 fi fi @@ -258,7 +258,7 @@ fi avahi-browse -atl | awk -F ' ' '{print $4}' | sort -u > $PEERS_FILE if [ ! -f $PEERS_FILE ]; then - echo 'No peers were found' + echo $'No peers were found' exit 0 fi @@ -268,7 +268,7 @@ while IFS='' read -r line || [[ -n "$line" ]]; do done < "$PEERS_FILE" if [ ${ctr} -lt "1" ]; then - echo 'No peers were found' + echo $'No peers were found' exit 0 fi @@ -279,9 +279,9 @@ echo "| | | " echo "|--- .--. .-. .-. .-.| .-. .--.--. |.-. .-. .--. .-. " echo "| | (.-' (.-' ( | ( )| | | | )( )| | (.-' " echo "' ' --' --' -' - -' ' ' -' -' -' ' - --'" -echo ' Freedom in the Mesh' +echo $' Freedom in the Mesh' echo '' -echo 'Please choose a peer to connect to:' +echo $'Please choose a peer to connect to:' idx=1 while IFS='' read -r line || [[ -n "$line" ]]; do echo " $idx. $line" @@ -293,7 +293,7 @@ read peer_index # if no selection made if [ ! $peer_index ]; then - echo 'Nothing was selected' + echo $'Nothing was selected' echo '' exit 0 fi @@ -309,7 +309,7 @@ while IFS='' read -r line || [[ -n "$line" ]]; do done < "$PEERS_FILE" if [ ! $AVAHI_DOMAIN ]; then - echo 'No domain name' + echo $'No domain name' exit 3 fi @@ -319,7 +319,7 @@ if [ ! -f $TOXIC_PATH ]; then $MUMBLE_PATH & exit 0 fi - echo 'You need mumble/toxic/qTox installed on your system' + echo $'You need mumble/toxic/qTox installed on your system' if [[ $SERVER_INSTALLATION == "no" ]]; then sudo batman stop fi @@ -332,16 +332,16 @@ if [ ! -f $MUMBLE_PATH ]; then fi echo '' -echo 'Choose communication service:' -echo ' 1. VoIP' -echo ' 2. Tox Chat' +echo $'Choose communication service:' +echo $' 1. VoIP' +echo $' 2. Tox Chat' echo '' read peer_index # if no selection made if [ ! $peer_index ]; then - echo 'Nothing was selected' + echo $'Nothing was selected' echo '' exit 0 fi @@ -349,18 +349,18 @@ fi if [[ $peer_index == 1 ]]; then if [ -f $MUMBLE_PATH ]; then echo '' - echo 'To setup for the first time click "Add New", then set:' - echo " Label: $AVAHI_DOMAIN" - echo " Address: $AVAHI_DOMAIN" - echo ' Port: 64738' - echo " Username: $USER" + echo $'To setup for the first time click "Add New", then set:' + echo $" Label: $AVAHI_DOMAIN" + echo $" Address: $AVAHI_DOMAIN" + echo $' Port: 64738' + echo $" Username: $USER" echo '' - echo 'Press Enter to continue.' + echo $'Press Enter to continue.' echo '' read peer_index $MUMBLE_PATH & else - echo 'Mumble may not be installed on this system' + echo $'Mumble may not be installed on this system' exit 5 fi fi diff --git a/src/freedombone-meshweb b/src/freedombone-meshweb index 60968f3a..95c983fb 100755 --- a/src/freedombone-meshweb +++ b/src/freedombone-meshweb @@ -56,7 +56,7 @@ function install_ipfs { if [ ! -d /home/$MY_USERNAME/.ipfs ]; then ipfs init -b 4096 if [ ! -d /home/$MY_USERNAME/.ipfs ]; then - echo "IPFS could not be initialised" + echo $"IPFS could not be initialised" exit 7358 fi @@ -78,7 +78,7 @@ function install_ipfs { IPFS_PEER_ID=$(ipfs id | grep '\"ID\":' | awk -F '\"' '{print $4}') if [ ${#IPFS_PEER_ID} -lt 10 ]; then - echo 'Invalid IPFS peer ID' + echo $'Invalid IPFS peer ID' echo "$IPFS_PEER_ID" exit 74782 fi @@ -107,7 +107,7 @@ function install_zeronet_blog { fi if [ ! -d /etc/avahi ]; then - echo 'Avahi is not installed' + echo $'Avahi is not installed' exit 736 fi @@ -116,7 +116,7 @@ function install_zeronet_blog { cd $ZERONET_DIR python zeronet.py --batch siteCreate 2> $ZERONET_DIR/blog.txt if [ ! -f $ZERONET_DIR/blog.txt ]; then - echo 'Unable to create blog' + echo $'Unable to create blog' exit 479 fi blog_address=$(cat blog.txt | grep "Site address" | awk -F ':' '{print $2}') @@ -125,32 +125,32 @@ function install_zeronet_blog { ZERONET_BLOG_PRIVATE_KEY=${blog_private_key//[[:blank:]]/} if [ ${#ZERONET_BLOG_ADDRESS} -lt 20 ]; then - echo "Address: $ZERONET_BLOG_ADDRESS" - echo "Public key: $ZERONET_BLOG_PRIVATE_KEY" - echo 'Unable to create zeronet blog address' + echo $"Address: $ZERONET_BLOG_ADDRESS" + echo $"Public key: $ZERONET_BLOG_PRIVATE_KEY" + echo $'Unable to create zeronet blog address' exit 7358 fi if [ ${#ZERONET_BLOG_PRIVATE_KEY} -lt 20 ]; then - echo "Address: $ZERONET_BLOG_ADDRESS" - echo "Public key: $ZERONET_BLOG_PRIVATE_KEY" - echo 'Unable to create zeronet blog private key' + echo $"Address: $ZERONET_BLOG_ADDRESS" + echo $"Public key: $ZERONET_BLOG_PRIVATE_KEY" + echo $'Unable to create zeronet blog private key' exit 1639 fi if [ ! -d "$ZERONET_DIR/data/$ZERONET_BLOG_ADDRESS" ]; then - echo "Unable to find site directory: $ZERONET_DIR/data/$ZERONET_BLOG_ADDRESS" + echo $"Unable to find site directory: $ZERONET_DIR/data/$ZERONET_BLOG_ADDRESS" exit 7638 fi git clone $ZERONET_BLOG_REPO ZeroBlog if [ ! -d $ZERONET_DIR/ZeroBlog ]; then - echo 'ZeroBlog repo could not be cloned' + echo $'ZeroBlog repo could not be cloned' exit 6739 fi - echo "Blog address: $ZERONET_BLOG_ADDRESS" - echo "Blog private key: $ZERONET_BLOG_PRIVATE_KEY" + echo $"Blog address: $ZERONET_BLOG_ADDRESS" + echo $"Blog private key: $ZERONET_BLOG_PRIVATE_KEY" cp -r $ZERONET_DIR/ZeroBlog/* $ZERONET_DIR/data/$ZERONET_BLOG_ADDRESS if [ ! -d $ZERONET_DIR/data/$ZERONET_BLOG_ADDRESS/data ]; then mkdir $ZERONET_DIR/data/$ZERONET_BLOG_ADDRESS/data @@ -184,11 +184,11 @@ function install_zeronet_blog { if ! grep -q "ZeroNet Blog address" /home/$MY_USERNAME/README; then echo '' >> /home/$MY_USERNAME/README - echo "ZeroNet Blog address: $ZERONET_BLOG_ADDRESS" >> /home/$MY_USERNAME/README - echo "ZeroNet Blog private key: $ZERONET_BLOG_PRIVATE_KEY" >> /home/$MY_USERNAME/README + echo $"ZeroNet Blog address: $ZERONET_BLOG_ADDRESS" >> /home/$MY_USERNAME/README + echo $"ZeroNet Blog private key: $ZERONET_BLOG_PRIVATE_KEY" >> /home/$MY_USERNAME/README fi - echo 'Zeronet blog installed' + echo $'Zeronet blog installed' } function install_zeronet_forum { @@ -201,7 +201,7 @@ function install_zeronet_forum { fi if [ ! -d /etc/avahi ]; then - echo 'Avahi is not installed' + echo $'Avahi is not installed' exit 736 fi @@ -210,7 +210,7 @@ function install_zeronet_forum { cd $ZERONET_DIR python zeronet.py --batch siteCreate 2> $ZERONET_DIR/forum.txt if [ ! -f $ZERONET_DIR/forum.txt ]; then - echo 'Unable to create forum' + echo $'Unable to create forum' exit 479 fi forum_address=$(cat forum.txt | grep "Site address" | awk -F ':' '{print $2}') @@ -219,31 +219,31 @@ function install_zeronet_forum { ZERONET_FORUM_PRIVATE_KEY=${forum_private_key//[[:blank:]]/} if [ ${#ZERONET_FORUM_ADDRESS} -lt 20 ]; then - echo "Address: $ZERONET_FORUM_ADDRESS" - echo "Public key: $ZERONET_FORUM_PRIVATE_KEY" - echo 'Unable to create zeronet forum address' + echo $"Address: $ZERONET_FORUM_ADDRESS" + echo $"Public key: $ZERONET_FORUM_PRIVATE_KEY" + echo $'Unable to create zeronet forum address' exit 76352 fi if [ ${#ZERONET_FORUM_PRIVATE_KEY} -lt 20 ]; then - echo "Address: $ZERONET_FORUM_ADDRESS" - echo "Public key: $ZERONET_FORUM_PRIVATE_KEY" - echo 'Unable to create zeronet forum private key' + echo $"Address: $ZERONET_FORUM_ADDRESS" + echo $"Public key: $ZERONET_FORUM_PRIVATE_KEY" + echo $'Unable to create zeronet forum private key' exit 87356 fi if [ ! -d "$ZERONET_DIR/data/$ZERONET_FORUM_ADDRESS" ]; then - echo "Unable to find site directory: $ZERONET_DIR/data/$ZERONET_FORUM_ADDRESS" + echo $"Unable to find site directory: $ZERONET_DIR/data/$ZERONET_FORUM_ADDRESS" exit 7638 fi git clone $ZERONET_FORUM_REPO ZeroTalk if [ ! -d $ZERONET_DIR/ZeroTalk ]; then - echo 'ZeroTalk repo could not be cloned' + echo $'ZeroTalk repo could not be cloned' exit 6739 fi - echo "Forum address: $ZERONET_FORUM_ADDRESS" - echo "Forum private key: $ZERONET_FORUM_PRIVATE_KEY" + echo $"Forum address: $ZERONET_FORUM_ADDRESS" + echo $"Forum private key: $ZERONET_FORUM_PRIVATE_KEY" cp -r $ZERONET_DIR/ZeroTalk/* $ZERONET_DIR/data/$ZERONET_FORUM_ADDRESS sed -i "s/ZeroBoard/$ZERONET_DEFAULT_FORUM_TITLE/g" $ZERONET_DIR/data/$ZERONET_FORUM_ADDRESS/index.html 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 { if ! grep -q "ZeroNet Forum address" /home/$MY_USERNAME/README; then echo '' >> /home/$MY_USERNAME/README - echo "ZeroNet Forum address: $ZERONET_FORUM_ADDRESS" >> /home/$MY_USERNAME/README - echo "ZeroNet Forum private key: $ZERONET_FORUM_PRIVATE_KEY" >> /home/$MY_USERNAME/README + echo $"ZeroNet Forum address: $ZERONET_FORUM_ADDRESS" >> /home/$MY_USERNAME/README + echo $"ZeroNet Forum private key: $ZERONET_FORUM_PRIVATE_KEY" >> /home/$MY_USERNAME/README fi - echo 'Zeronet forum installed' + echo $'Zeronet forum installed' } function install_web_server { @@ -299,7 +299,7 @@ function install_web_server { sudo apt-get -y install nginx if [ ! -d /etc/nginx ]; then - echo 'Unable to install web server' + echo $'Unable to install web server' exit 51 fi } @@ -362,7 +362,7 @@ fi avahi-browse -atl | awk -F ' ' '{print $4}' | sort -u > $PEERS_FILE if [ ! -f $PEERS_FILE ]; then - echo 'No peers were found' + echo $'No peers were found' exit 0 fi @@ -374,12 +374,12 @@ done < "$PEERS_FILE" rm $PEERS_FILE if [ ${ctr} -lt "1" ]; then - echo 'No peers were found' + echo $'No peers were found' exit 0 fi if [ ! -d $ZERONET_DIR ]; then - echo 'zeronet was not installed' + echo $'zeronet was not installed' exit 63 fi cd $ZERONET_DIR diff --git a/src/freedombone-prep b/src/freedombone-prep index 0782ac20..6d0a6560 100755 --- a/src/freedombone-prep +++ b/src/freedombone-prep @@ -71,9 +71,9 @@ CURR_DIR=$(pwd) function show_help { echo '' - echo 'freedombone-prep -i [image filename] -d [microSD device] --ip [BBB LAN IP address] --iprouter [Router LAN IP address] --mount [mount directory]' + echo $'freedombone-prep -i [image filename] -d [microSD device] --ip [BBB LAN IP address] --iprouter [Router LAN IP address] --mount [mount directory]' echo '' - echo 'See the manpage for more details' + echo $'See the manpage for more details' echo '' } @@ -154,8 +154,8 @@ if [ -d /media ]; then fi fi if [ ! -d $MICROSD_MOUNT_POINT ]; then - echo "The mount directory $MICROSD_MOUNT_POINT does not exist." - echo 'Use the --mount option to specify where the microSD gets mounted to.' + echo $"The mount directory $MICROSD_MOUNT_POINT does not exist." + echo $'Use the --mount option to specify where the microSD gets mounted to.' exit 67563 fi @@ -214,9 +214,9 @@ done if [ ! $MICROSD_DRIVE ]; then - echo 'You need to specify a drive for the connected microSD.' - echo 'This can most easily be found by removing the microSD, then' - echo 'running:' + echo $'You need to specify a drive for the connected microSD.' + echo $'This can most easily be found by removing the microSD, then' + echo $'running:' echo '' echo ' ls /dev/sd*' echo '' @@ -224,7 +224,7 @@ if [ ! $MICROSD_DRIVE ]; then echo '' echo ' ls /dev/mmcblk*' echo '' - echo 'Then plugging the microSD back in and entering the same command again' + echo $'Then plugging the microSD back in and entering the same command again' exit 1 fi @@ -232,7 +232,7 @@ if [ ! -b ${MICROSD_DRIVE}${PARTITION_NUMBER} ]; then if [ -b ${MICROSD_DRIVE}p${PARTITION_NUMBER} ]; then PARTITION_NUMBER=p${PARTITION_NUMBER} else - echo "The microSD drive could not be found at ${MICROSD_DRIVE}1" + echo $"The microSD drive could not be found at ${MICROSD_DRIVE}1" exit 2 fi fi @@ -258,7 +258,7 @@ if [ $DEBIAN_IMAGE_FILENAME ]; then DEBIAN_IMAGE_FILENAME=${files[0]} fi if [[ $DEBIAN_IMAGE_FILENAME != *".img" ]]; then - echo 'Debian image (.img) file expected' + echo $'Debian image (.img) file expected' exit 62394 fi DEBIAN_FILE_NAME=$DEBIAN_IMAGE_FILENAME @@ -278,12 +278,12 @@ else fi if [ ! -f ~/freedombone/$DEBIAN_FILE_NAME ]; then - echo "Couldn't extract image $DEBIAN_FILE_NAME" + echo $"Couldn't extract image $DEBIAN_FILE_NAME" exit 4 fi cd ~/freedombone -echo 'Flashing image. This may take a while.' +echo $'Flashing image. This may take a while.' #$SUDO dd if=$DEBIAN_FILE_NAME of=$MICROSD_DRIVE sync @@ -298,24 +298,24 @@ sync if [ ! -b ${MICROSD_DRIVE}${PARTITION_NUMBER} ]; then echo '' - echo "The microSD drive could not be found at ${MICROSD_DRIVE}${PARTITION_NUMBER}" - read -p "Wait for the drive to mount then press any key... " -n1 -s + echo $"The microSD drive could not be found at ${MICROSD_DRIVE}${PARTITION_NUMBER}" + read -p $"Wait for the drive to mount then press any key... " -n1 -s if [ ! -b ${MICROSD_DRIVE}${PARTITION_NUMBER} ]; then - echo "microSD drive not found at ${MICROSD_DRIVE}${PARTITION_NUMBER}" + echo $"microSD drive not found at ${MICROSD_DRIVE}${PARTITION_NUMBER}" exit 5 fi fi if [ ! -d $MICROSD_MOUNT_POINT/$ROOTFS ]; then echo '' - echo "The rootfs partition $MICROSD_MOUNT_POINT/$ROOTFS was not found." + echo $"The rootfs partition $MICROSD_MOUNT_POINT/$ROOTFS was not found." ls $MICROSD_MOUNT_POINT exit 65688 fi if [ ! -d $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/home ]; then echo '' - echo "The rootfs partition was not written correctly." + echo $"The rootfs partition was not written correctly." ls $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR exit 65688 fi @@ -328,7 +328,7 @@ $SUDO cp -f $(which zeronetavahi)* $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/us $SUDO cp -f $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/usr/local/bin/freedombone-mesh $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/usr/local/bin/mesh $SUDO cp -f $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/usr/local/bin/freedombone-meshweb $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/usr/local/bin/meshweb if [ ! -f $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/usr/local/bin/freedombone ]; then - echo 'There was a problem with writing freedombone commands to the SD card' + echo $'There was a problem with writing freedombone commands to the SD card' exit 8736 fi @@ -339,18 +339,18 @@ fi # change the motd to show further install instructions echo '' >> /tmp/freedombone_motd -echo 'Create a user for the system with:' >> /tmp/freedombone_motd +echo $'Create a user for the system with:' >> /tmp/freedombone_motd echo '' >> /tmp/freedombone_motd echo ' adduser [username]' >> /tmp/freedombone_motd echo '' >> /tmp/freedombone_motd -echo 'Enter the command "exit" a couple of times to get back to your main system' >> /tmp/freedombone_motd -echo 'then log back in as the user you just created with:' >> /tmp/freedombone_motd +echo $'Enter the command "exit" a couple of times to get back to your main system' >> /tmp/freedombone_motd +echo $'then log back in as the user you just created with:' >> /tmp/freedombone_motd echo '' >> /tmp/freedombone_motd echo " ssh [username]@$BOX_IP_ADDRESS" >> /tmp/freedombone_motd echo '' >> /tmp/freedombone_motd -echo 'and use the "su" command to become the root user again.' >> /tmp/freedombone_motd +echo $'and use the "su" command to become the root user again.' >> /tmp/freedombone_motd echo '' >> /tmp/freedombone_motd -echo 'Finally you can use the freedombone command to install a server configuration:' >> /tmp/freedombone_motd +echo $'Finally you can use the freedombone command to install a server configuration:' >> /tmp/freedombone_motd echo '' >> /tmp/freedombone_motd echo ' apt-get update' >> /tmp/freedombone_motd echo ' apt-get -y install git dialog build-essential' >> /tmp/freedombone_motd @@ -359,17 +359,17 @@ echo ' freedombone menuconfig' >> /tmp/freedombone_motd $SUDO cp -f /tmp/freedombone_motd $MICROSD_MOUNT_POINT/$ROOTFS$ROOTFS_SUBDIR/etc/motd clear -echo '*** Initial microSD card setup is complete ***' +echo $'*** Initial microSD card setup is complete ***' echo '' -echo 'To avoid running out of disk space you may first wish to resize the' -echo 'partition to the size of your microSD card, using something like gparted.' +echo $'To avoid running out of disk space you may first wish to resize the' +echo $'partition to the size of your microSD card, using something like gparted.' echo '' -echo 'The microSD card can now be removed and inserted into the Beaglebone Black.' -echo 'Once the Beaglebone has booted then you can log in with:' +echo $'The microSD card can now be removed and inserted into the Beaglebone Black.' +echo $'Once the Beaglebone has booted then you can log in with:' echo '' echo " ssh root@$BOX_IP_ADDRESS" echo '' -echo 'The root password should be changed with the command "passwd".' +echo $'The root password should be changed with the command "passwd".' cat /tmp/freedombone_motd rm /tmp/freedombone_motd $SUDO umount $MICROSD_MOUNT_POINT/$ROOTFS diff --git a/src/freedombone-recoverkey b/src/freedombone-recoverkey index fc6ef101..77a77497 100755 --- a/src/freedombone-recoverkey +++ b/src/freedombone-recoverkey @@ -39,8 +39,8 @@ GPG_USB_DRIVE='sdb1' function show_help { echo '' - echo 'freedombone-recoverkey -u [username] -d [drive]' - echo ' -l [friends servers list filename]' + echo $'freedombone-recoverkey -u [username] -d [drive]' + echo $' -l [friends servers list filename]' echo '' exit 0 } @@ -78,16 +78,16 @@ if [ ! $MY_USERNAME ]; then show_help fi if [ ! -d /home/$MY_USERNAME ]; then - echo "User $MY_USERNAME does not exist on the system" + echo $"User $MY_USERNAME does not exist on the system" exit 7270 fi if [ ! $MY_USERNAME ]; then - echo 'No username given' + echo $'No username given' exit 3578 fi if [ ! -d /home/$MY_USERNAME ]; then - echo "User $MY_USERNAME does not exist on the system" + echo $"User $MY_USERNAME does not exist on the system" exit 7270 fi @@ -117,7 +117,7 @@ function reconstruct_key { su -c "gpg --allow-secret-key-import --import $KEYS_FILE" - $MY_USERNAME if [ ! "$?" = "0" ]; then - echo 'Unable to import gpg key' + echo $'Unable to import gpg key' shred -zu $KEYS_FILE rm -rf /home/$MY_USERNAME/.tempgnupg exit 9654 @@ -256,13 +256,13 @@ if [ $FRIENDS_SERVERS_LIST ]; then mkdir -p /home/$MY_USERNAME/.gnupg_fragments fi - echo -n "Starting key retrieval from $REMOTE_SERVER..." + echo -n $"Starting key retrieval from $REMOTE_SERVER..." /usr/bin/sshpass -p $REMOTE_PASSWORD \ scp -r -P $REMOTE_SSH_PORT $REMOTE_SERVER/.gnupg_fragments/* /home/$MY_USERNAME/.gnupg_fragments if [ ! "$?" = "0" ]; then - echo 'FAILED' + echo $'FAILED' else - echo 'Ok' + echo $'Ok' fi fi done < $FRIENDS_SERVERS_LIST @@ -270,7 +270,7 @@ fi # was a directory created? if [ ! -d $FRAGMENTS_DIR ]; then - echo 'No fragments have been recovered, so the key cannot be recovered' + echo $'No fragments have been recovered, so the key cannot be recovered' exit 7483 fi @@ -278,7 +278,7 @@ fi cd $FRAGMENTS_DIR no_of_shares=$(ls -afq keyshare.asc.* | wc -l) if (( no_of_shares == 0 )); then - echo 'No key fragments were retrieved' + echo $'No key fragments were retrieved' exit 76882 fi @@ -291,16 +291,16 @@ cd $FRAGMENTS_DIR gfcombine $KEYS_FILE.* if [ ! -f $KEYS_FILE ]; then - echo 'Unable to decrypt key. This may mean that not enough fragments are available' + echo $'Unable to decrypt key. This may mean that not enough fragments are available' exit 6283 fi -echo 'Key fragments recombined' +echo $'Key fragments recombined' # import the gpg key su -c "gpg --allow-secret-key-import --import $KEYS_FILE" - $MY_USERNAME if [ ! "$?" = "0" ]; then - echo 'Unable to import gpg key' + echo $'Unable to import gpg key' shred -zu $KEYS_FILE exit 3682 fi @@ -308,6 +308,6 @@ shred -zu $KEYS_FILE chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.gnupg chmod -R 600 /home/$MY_USERNAME/.gnupg -echo 'GPG key was recovered' +echo $'GPG key was recovered' exit 0 diff --git a/src/freedombone-remote b/src/freedombone-remote index 4d124233..3c02e63a 100755 --- a/src/freedombone-remote +++ b/src/freedombone-remote @@ -57,17 +57,17 @@ RECIPROCAL="no" function show_help { echo '' - echo 'freedombone-remote -u [username] -l [backup list filename] -m [min password length]' + echo $'freedombone-remote -u [username] -l [backup list filename] -m [min password length]' echo '' - echo 'Creates an inventory of remote backup locations' + echo $'Creates an inventory of remote backup locations' echo '' echo '' - echo ' -h --help Show help' - echo ' -u --username User to create the backups.list file for' - echo ' -l --list Remote backup list (usually /home/$USER/backup.list)' - echo ' -m --min Minimum password length (characters)' - echo ' -r --reciprocal Whether to add reciprocal user accounts' - echo ' -t --title Title shown' + echo $' -h --help Show help' + echo $' -u --username User to create the backups.list file for' + echo $' -l --list Remote backup list (usually /home/$USER/backup.list)' + echo $' -m --min Minimum password length (characters)' + echo $' -r --reciprocal Whether to add reciprocal user accounts' + echo $' -t --title Title shown' echo '' exit 0 } @@ -117,12 +117,12 @@ done function interactive_configuration_remote_backups { if [ ! $MY_USERNAME ]; then - echo 'Please specify a username with the -u option' + echo $'Please specify a username with the -u option' exit 7356 fi if [ ! /home/$MY_USERNAME ]; then - echo "The user /home/$MY_USERNAME does not exist on the system" + echo $"The user /home/$MY_USERNAME does not exist on the system" exit 3689 fi @@ -238,17 +238,17 @@ function interactive_configuration_remote_backups { function show_result { clear if (( $entering_remote_backups_ctr < 2 )); then - echo 'No remote backup locations were specified' + echo $'No remote backup locations were specified' exit 0 fi if [ ! -f $FRIENDS_SERVERS_LIST ]; then - echo "No remote backups list found: $FRIENDS_SERVERS_LIST" + echo $"No remote backups list found: $FRIENDS_SERVERS_LIST" exit 7358 fi echo '' - echo "Remote backups list: $FRIENDS_SERVERS_LIST" + echo $"Remote backups list: $FRIENDS_SERVERS_LIST" echo '' - echo 'Contents:' + echo $'Contents:' echo '' cat $FRIENDS_SERVERS_LIST echo '' diff --git a/src/freedombone-renew-cert b/src/freedombone-renew-cert index 50e35523..cd104310 100755 --- a/src/freedombone-renew-cert +++ b/src/freedombone-renew-cert @@ -40,32 +40,32 @@ LETSENCRYPT_SERVER='https://acme-v01.api.letsencrypt.org/directory' function show_help { echo '' - echo 'freedombone-renew-cert -h [hostname] -p [provider]' + echo $'freedombone-renew-cert -h [hostname] -p [provider]' echo '' - echo 'Makes it easier to renew a ssl/tls certificate for a website' + echo $'Makes it easier to renew a ssl/tls certificate for a website' echo '' - echo ' --help Show help' - echo ' -h --hostname [name] Hostname' - echo ' -p --provider [name] eg. startssl/letsencrypt' + echo $' --help Show help' + echo $' -h --hostname [name] Hostname' + echo $' -p --provider [name] eg. startssl/letsencrypt' echo '' exit 0 } function renew_letsencrypt { if [ ! -f /etc/letsencrypt/live/${HOSTNAME}/fullchain.pem ]; then - echo "Adding Let's Encrypt certificate" + echo $"Adding Let's Encrypt certificate" freedombone-addcert -e $HOSTNAME -s $LETSENCRYPT_SERVER --dhkey $DH_KEYLENGTH if [ ! "$?" = "0" ]; then - echo "Unable to add Let's encrypt certificate" + echo $"Unable to add Let's encrypt certificate" exit 6328 fi else - echo "Renewing Let's Encrypt certificate" + echo $"Renewing Let's Encrypt certificate" letsencrypt renew \ --cert-path /etc/letsencrypt/live/${HOSTNAME}/fullchain.pem \ --key-path /etc/letsencrypt/live/${HOSTNAME}/privkey.pem if [ ! "$?" = "0" ]; then - echo "Unable to renew Let's encrypt certificate" + echo $"Unable to renew Let's encrypt certificate" exit 2624 fi fi @@ -76,10 +76,10 @@ function renew_letsencrypt { } function renew_startssl { - echo 'Renewing StartSSL certificate' + echo $'Renewing StartSSL certificate' if [ -s /etc/ssl/certs/$HOSTNAME.new.crt ]; then if ! grep -q "-BEGIN CERTIFICATE-" /etc/ssl/certs/$HOSTNAME.new.crt; then - echo '/etc/ssl/certs/$HOSTNAME.new.crt does not contain a public key' + echo $'/etc/ssl/certs/$HOSTNAME.new.crt does not contain a public key' return fi @@ -137,18 +137,18 @@ function renew_startssl { # update your site to include the bundle sed -i "s|$HOSTNAME.crt|$HOSTNAME.bundle.crt|g" /etc/nginx/sites-available/$HOSTNAME - echo 'Certificate installed' + echo $'Certificate installed' service nginx restart return fi if [ -f /etc/ssl/requests/$HOSTNAME.csr ]; then - echo 'Certificate request already created:' + echo $'Certificate request already created:' echo '' cat /etc/ssl/requests/$HOSTNAME.csr echo '' - echo "Save the requested public key to /etc/ssl/certs/$HOSTNAME.new.crt" - echo 'then run this command again.' + echo $"Save the requested public key to /etc/ssl/certs/$HOSTNAME.new.crt" + echo $'then run this command again.' echo '' return fi @@ -162,14 +162,14 @@ function renew_startssl { echo '' cat /etc/ssl/requests/$HOSTNAME.csr echo '' - echo 'On the StartSSL site select Certificates Wizard then' - echo 'Web server SSL/TLS Certificate. You can then click on "skip"' - echo 'and then copy and paste the above certificate request into the text' - echo 'entry box. You may now need to wait a few hours for a confirmation' - echo 'email indicating that the new certificate was created.' + echo $'On the StartSSL site select Certificates Wizard then' + echo $'Web server SSL/TLS Certificate. You can then click on "skip"' + echo $'and then copy and paste the above certificate request into the text' + echo $'entry box. You may now need to wait a few hours for a confirmation' + echo $'email indicating that the new certificate was created.' echo '' - echo 'Once you have retrieved the new public certificate paste it to:' - echo "/etc/ssl/certs/$HOSTNAME.new.crt then run this command again." + echo $'Once you have retrieved the new public certificate paste it to:' + echo $"/etc/ssl/certs/$HOSTNAME.new.crt then run this command again." echo '' } @@ -197,18 +197,18 @@ shift done if [ ! $HOSTNAME ]; then - echo 'No hostname specified' + echo $'No hostname specified' exit 5748 fi if ! which openssl > /dev/null ;then - echo "$0: openssl is not installed, exiting" 1>&2 + echo $"$0: openssl is not installed, exiting" 1>&2 exit 5689 fi # check that the web site exists if [ ! -f /etc/nginx/sites-available/$HOSTNAME ]; then - echo "/etc/nginx/sites-available/$HOSTNAME does not exist" + echo $"/etc/nginx/sites-available/$HOSTNAME does not exist" exit 7598 fi @@ -218,7 +218,7 @@ else if [[ $PROVIDER == 'letsencrypt' ]]; then renew_letsencrypt else - echo "$PROVIDER is not currently supported" + echo $"$PROVIDER is not currently supported" fi fi diff --git a/src/freedombone-rmemail b/src/freedombone-rmemail index 8b665621..d9a23a20 100755 --- a/src/freedombone-rmemail +++ b/src/freedombone-rmemail @@ -38,7 +38,7 @@ MYUSERNAME=$USER function show_help { echo '' - echo 'freedombone-rmemail -u [username] -e [email address]' + echo $'freedombone-rmemail -u [username] -e [email address]' echo '' exit 0 } diff --git a/src/freedombone-rmlist b/src/freedombone-rmlist index 19ccc5b3..abccda60 100755 --- a/src/freedombone-rmlist +++ b/src/freedombone-rmlist @@ -40,7 +40,7 @@ LIST_ADDRESS= function show_help { echo '' - echo 'freedombone-rmlist -u [username] -l [mailing list name] -e [list email address]' + echo $'freedombone-rmlist -u [username] -l [mailing list name] -e [list email address]' echo '' exit 0 } diff --git a/src/freedombone-rmsipuser b/src/freedombone-rmsipuser index e25a84c3..f0aef026 100755 --- a/src/freedombone-rmsipuser +++ b/src/freedombone-rmsipuser @@ -40,7 +40,7 @@ USER_EXISTS="no" function show_help { echo '' - echo 'freedombone-rmsipuser [username]' + echo $'freedombone-rmsipuser [username]' echo '' exit 0 } @@ -85,20 +85,20 @@ if [ ! $MY_USERNAME ]; then fi if [ ! -f $CONFIG_FILE ]; then - echo "SIP configuration file not found" + echo $"SIP configuration file not found" exit 1 fi # the user must already exist on the system if [ ! -d /home/$MY_USERNAME ]; then - echo "User $MY_USERNAME not found" + echo $"User $MY_USERNAME not found" exit 2 fi sip_user_exists if [[ $USER_EXISTS != "yes" ]]; then - echo 'User not found within SIP configuration file' + echo $'User not found within SIP configuration file' exit 3 fi @@ -108,5 +108,5 @@ remove_sip_user systemctl start sipwitch -echo "SIP user $MY_USERNAME removed" +echo $"SIP user $MY_USERNAME removed" exit 0 diff --git a/src/freedombone-rmuser b/src/freedombone-rmuser index 7f266c93..c411136c 100755 --- a/src/freedombone-rmuser +++ b/src/freedombone-rmuser @@ -9,40 +9,40 @@ MY_USERNAME=$1 COMPLETION_FILE=$HOME/freedombone-completed.txt if [ ! $MY_USERNAME ]; then - echo 'Please specify a username to remove' + echo $'Please specify a username to remove' exit 1 fi if [ ! -d /home/$MY_USERNAME ]; then - echo "Home directory does not exist for $MY_USERNAME" + echo $"Home directory does not exist for $MY_USERNAME" exit 2 fi if [ ! -f $COMPLETION_FILE ]; then - echo "$COMPLETION_FILE not found" + echo $"$COMPLETION_FILE not found" exit 3 fi if ! grep -q "Admin user" $COMPLETION_FILE; then - echo "No admin user specified in $COMPLETION_FILE" + echo $"No admin user specified in $COMPLETION_FILE" exit 4 fi ADMIN_USERNAME=$(cat $COMPLETION_FILE | grep "Admin user" | awk -F ':' '{print $2}') if [ ! $ADMIN_USERNAME ]; then - echo "No admin username specified in $COMPLETION_FILE" + echo $"No admin username specified in $COMPLETION_FILE" exit 5 fi if [[ $MY_USERNAME == $ADMIN_USERNAME ]]; then - echo "The administrator user cannot be removed" + echo $"The administrator user cannot be removed" exit 6 fi -echo '>>> REMOVE USER <<<' -read -p "Do you really wish to remove the user '$MY_USERNAME' (y/n) ?" yn +echo $'>>> REMOVE USER <<<' +read -p $"Do you really wish to remove the user '$MY_USERNAME' (y/n) ?" yn if [[ $yn != 'y' && $yn != 'Y' && $yn != 'yes' && $yn != 'Yes' && $yn != 'YES' ]]; then - echo "User $MY_USERNAME was not removed" + echo $"User $MY_USERNAME was not removed" exit 7 fi @@ -71,6 +71,6 @@ if [ -d /home/$MY_USERNAME ]; then rm -rf /home/$MY_USERNAME fi -echo "User $MY_USERNAME was removed" +echo $"User $MY_USERNAME was removed" exit 0 diff --git a/src/freedombone-rmxmpp b/src/freedombone-rmxmpp index ab1fc49d..4f424f05 100755 --- a/src/freedombone-rmxmpp +++ b/src/freedombone-rmxmpp @@ -38,7 +38,7 @@ EMAIL_ADDRESS= function show_help { echo '' - echo 'freedombone-rmxmpp -e [email address]' + echo $'freedombone-rmxmpp -e [email address]' echo '' exit 0 } diff --git a/src/freedombone-sec b/src/freedombone-sec index 1e8ff9e3..28e0665e 100755 --- a/src/freedombone-sec +++ b/src/freedombone-sec @@ -156,7 +156,7 @@ function change_website_settings { sed -i "s|ssl_ciphers .*|ssl_ciphers '$SSL_CIPHERS';|g" $WEBSITES_DIRECTORY/$file done service nginx restart - echo 'Web security settings changed' + echo $'Web security settings changed' } function change_imap_settings { @@ -172,14 +172,14 @@ function change_imap_settings { sed -i "s|ssl_cipher_list.*|ssl_cipher_list = '$SSL_CIPHERS'|g" $DOVECOT_CIPHERS sed -i "s|ssl_protocols.*|ssl_protocols = '$SSL_PROTOCOLS'|g" $DOVECOT_CIPHERS service dovecot restart - echo 'imap security settings changed' + echo $'imap security settings changed' } function change_ssh_settings { if [ -f /etc/ssh/ssh_config ]; then if [ $SSH_HOST_KEY_ALGORITHMS ]; then sed -i "s|HostKeyAlgorithms .*|HostKeyAlgorithms $SSH_HOST_KEY_ALGORITHMS|g" /etc/ssh/ssh_config - echo 'ssh client security settings changed' + echo $'ssh client security settings changed' fi fi if [ -f $SSH_CONFIG ]; then @@ -201,7 +201,7 @@ function change_ssh_settings { sed -i "s|KexAlgorithms .*|KexAlgorithms $SSH_KEX|g" $SSH_CONFIG sed -i "s|PasswordAuthentication .*|PasswordAuthentication $SSH_PASSWORDS|g" $SSH_CONFIG service ssh restart - echo 'ssh server security settings changed' + echo $'ssh server security settings changed' fi } @@ -218,7 +218,7 @@ function change_xmpp_settings { sed -i "s|ciphers =.*|ciphers = \"$XMPP_CIPHERS\";|g" $XMPP_CONFIG sed -i "s|curve =.*|curve = \"$XMPP_ECC_CURVE\";|g" $XMPP_CONFIG service prosody restart - echo 'xmpp security settings changed' + echo $'xmpp security settings changed' } function interactive_setup { @@ -316,10 +316,10 @@ function interactive_setup { sel=$? case $sel in 1) clear - echo 'Exiting without changing security settings' + echo $'Exiting without changing security settings' exit 0;; 255) clear - echo 'Exiting without changing security settings' + echo $'Exiting without changing security settings' exit 0;; esac @@ -330,11 +330,11 @@ function regenerate_ssh_host_keys { if [[ $REGENERATE_SSH_HOST_KEYS == "yes" ]]; then rm -f /etc/ssh/ssh_host_* dpkg-reconfigure openssh-server - echo 'ssh host keys regenerated' + echo $'ssh host keys regenerated' # remove small moduli awk '$5 > 2000' /etc/ssh/moduli > ~/moduli mv ~/moduli /etc/ssh/moduli - echo 'ssh small moduli removed' + echo $'ssh small moduli removed' systemctl restart ssh fi } @@ -342,7 +342,7 @@ function regenerate_ssh_host_keys { function regenerate_dh_keys { if [[ $REGENERATE_DH_KEYS == "yes" ]]; then if [ ! -d /etc/ssl/mycerts ]; then - echo 'No dhparam certificates were found' + echo $'No dhparam certificates were found' return fi @@ -376,7 +376,7 @@ function regenerate_dh_keys { fi fi done - echo "$ctr dhparam certificates were regenerated" + echo $"$ctr dhparam certificates were regenerated" fi } @@ -500,7 +500,7 @@ function import_settings { fi if [ ! -f $IMPORT_FILE ]; then - echo "Import file $IMPORT_FILE not found" + echo $"Import file $IMPORT_FILE not found" exit 6393 fi @@ -662,20 +662,20 @@ function export_settings { echo "XMPP_ECC_CURVE=$XMPP_ECC_CURVE" >> $EXPORT_FILE fi fi - echo "Security settings exported to $EXPORT_FILE" + echo $"Security settings exported to $EXPORT_FILE" exit 0 } function show_help { echo '' - echo 'freedombone-sec' + echo "${PROJECT_NAME}-sec" echo '' - echo 'Alters the security settings' + echo $'Alters the security settings' echo '' echo '' - echo ' -h --help Show help' - echo ' -e --export Export security settings to a file' - echo ' -i --import Import security settings from a file' + echo $' -h --help Show help' + echo $' -e --export Export security settings to a file' + echo $' -i --import Import security settings from a file' echo '' exit 0 } diff --git a/src/freedombone-splitkey b/src/freedombone-splitkey index ba9d9567..248af402 100755 --- a/src/freedombone-splitkey +++ b/src/freedombone-splitkey @@ -46,7 +46,7 @@ MY_NAME= function show_help { echo '' - echo 'freedombone-splitkey -u [username] -n [number of fragments] -e [email address] --fullname [Full name]' + echo $'freedombone-splitkey -u [username] -n [number of fragments] -e [email address] --fullname [Full name]' echo '' exit 0 } @@ -86,12 +86,12 @@ if [ ! $MY_USERNAME ]; then show_help fi if [ ! -d /home/$MY_USERNAME ]; then - echo "User $MY_USERNAME does not exist on the system" + echo $"User $MY_USERNAME does not exist on the system" exit 7270 fi if [ ! -d /home/$MY_USERNAME/.gnupg ]; then - echo 'No gpg key found' + echo $'No gpg key found' exit 5393 fi @@ -107,7 +107,7 @@ fi KEYID=$(su -c "gpg --list-keys $MY_EMAIL_ADDRESS | grep 'pub '" - \ $MY_USERNAME | awk -F ' ' '{print $2}' | awk -F '/' '{print $2}') if [ ${#KEYID} -lt 4 ]; then - echo "gpg key for $MY_EMAIL_ADDRESS was not found" + echo $"gpg key for $MY_EMAIL_ADDRESS was not found" return 3682 fi @@ -115,7 +115,7 @@ MY_BACKUP_KEY_ID=$(gpg --list-keys "$MY_NAME (backup key)" | \ grep 'pub ' | awk -F ' ' '{print $2}' | \ awk -F '/' '{print $2}') if [ ${#MY_BACKUP_KEY_ID} -lt 4 ]; then - echo "gpg backup key for '$MY_NAME' was not found" + echo $"gpg backup key for '$MY_NAME' was not found" return 58213 fi @@ -124,25 +124,25 @@ mkdir -p $FRAGMENTS_DIR KEYS_FILE=$FRAGMENTS_DIR/keyshare.asc gpg --output $FRAGMENTS_DIR/pubkey.txt --armor --export $KEYID if [ ! "$?" = "0" ]; then - echo "Unable to extract public key for $KEYID" + echo $"Unable to extract public key for $KEYID" exit 7835 fi gpg --output $FRAGMENTS_DIR/privkey.txt \ --armor --export-secret-key $KEYID if [ ! "$?" = "0" ]; then - echo "Unable to extract private key for $KEYID" + echo $"Unable to extract private key for $KEYID" exit 7823 fi gpg --output $FRAGMENTS_DIR/backup_pubkey.txt \ --armor --export $MY_BACKUP_KEY_ID if [ ! "$?" = "0" ]; then - echo "Unable to extract backup public key for $MY_BACKUP_KEY_ID" + echo $"Unable to extract backup public key for $MY_BACKUP_KEY_ID" exit 62928 fi gpg --output $FRAGMENTS_DIR/backup_privkey.txt \ --armor --export-secret-key $MY_BACKUP_KEY_ID if [ ! "$?" = "0" ]; then - echo "Unable to extract backup private key for $MY_BACKUP_KEY_ID" + echo $"Unable to extract backup private key for $MY_BACKUP_KEY_ID" exit 13783 fi @@ -158,7 +158,7 @@ shred -zu $FRAGMENTS_DIR/backup_pubkey.txt KEY_SHARES=$((KEY_FRAGMENTS * 2)) gfsplit -n $KEY_FRAGMENTS -m $KEY_SHARES $KEYS_FILE if [ ! "$?" = "0" ]; then - echo "Unable to split the gpg key" + echo $"Unable to split the gpg key" rm -rf $FRAGMENTS_DIR if [ -f $KEYS_FILE ]; then shred -zu $KEYS_FILE @@ -171,6 +171,6 @@ shred -zu $KEYS_FILE chown -R $MY_USERNAME:$MY_USERNAME $FRAGMENTS_DIR chmod -R 600 $FRAGMENTS_DIR -echo "$KEY_SHARES key shares created" +echo $"$KEY_SHARES key shares created" exit 0 diff --git a/src/freedombone-unignore b/src/freedombone-unignore index 6d13941d..4dfc59e6 100755 --- a/src/freedombone-unignore +++ b/src/freedombone-unignore @@ -41,7 +41,7 @@ SUBJECT_TEXT= function show_help { echo '' - echo 'freedombone-unignore -u [username] -e [mail address] -t [text in subject line]' + echo $'freedombone-unignore -u [username] -e [mail address] -t [text in subject line]' echo '' exit 0 } diff --git a/src/freedombone-xmpp-pass b/src/freedombone-xmpp-pass index 7dd0151c..dd1b326f 100755 --- a/src/freedombone-xmpp-pass +++ b/src/freedombone-xmpp-pass @@ -38,7 +38,7 @@ EMAIL_ADDRESS= function show_help { echo '' - echo 'freedombone-xmpp-pass -e [email address]' + echo $'freedombone-xmpp-pass -e [email address]' echo '' exit 0 }