Browse Source

More single quotes

Bob Mottram 10 years ago
parent
commit
9fa8be09d2
1 changed files with 30 additions and 30 deletions
  1. 30
    30
      install-freedombone.sh

+ 30
- 30
install-freedombone.sh View File

@@ -62,7 +62,7 @@ function enable_zram {
62 62
   echo '    # get the number of CPUs' >> /etc/init.d/zram
63 63
   echo '    num_cpus=$(grep -c processor /proc/cpuinfo)' >> /etc/init.d/zram
64 64
   echo '    # if something goes wrong, assume we have 1' >> /etc/init.d/zram
65
-  echo '    [ \"$num_cpus\" != 0 ] || num_cpus=1' >> /etc/init.d/zram
65
+  echo '    [ "$num_cpus" != 0 ] || num_cpus=1' >> /etc/init.d/zram
66 66
   echo '    # set decremented number of CPUs' >> /etc/init.d/zram
67 67
   echo '    decr_num_cpus=$((num_cpus - 1))' >> /etc/init.d/zram
68 68
   echo '    # get the amount of memory in the machine' >> /etc/init.d/zram
@@ -90,7 +90,7 @@ function enable_zram {
90 90
   echo '    decr_num_cpus=$((num_cpus - 1))' >> /etc/init.d/zram
91 91
   echo '    # Switching off swap' >> /etc/init.d/zram
92 92
   echo '    for i in $(seq 0 $decr_num_cpus); do' >> /etc/init.d/zram
93
-  echo '    if [ \"$(grep /dev/zram$i /proc/swaps)\" != \"\" ]; then' >> /etc/init.d/zram
93
+  echo '    if [ "$(grep /dev/zram$i /proc/swaps)" != "" ]; then' >> /etc/init.d/zram
94 94
   echo '    swapoff /dev/zram$i' >> /etc/init.d/zram
95 95
   echo '    sleep 1' >> /etc/init.d/zram
96 96
   echo '    fi' >> /etc/init.d/zram
@@ -98,7 +98,7 @@ function enable_zram {
98 98
   echo '    sleep 1' >> /etc/init.d/zram
99 99
   echo '    rmmod zram' >> /etc/init.d/zram
100 100
   echo '}' >> /etc/init.d/zram
101
-  echo 'case \"$1\" in' >> /etc/init.d/zram
101
+  echo 'case "$1" in' >> /etc/init.d/zram
102 102
   echo '    start)' >> /etc/init.d/zram
103 103
   echo '        start' >> /etc/init.d/zram
104 104
   echo '        ;;' >> /etc/init.d/zram
@@ -111,7 +111,7 @@ function enable_zram {
111 111
   echo '        start' >> /etc/init.d/zram
112 112
   echo '        ;;' >> /etc/init.d/zram
113 113
   echo '    *)' >> /etc/init.d/zram
114
-  echo '        echo \"Usage: $0 {start|stop|restart}\"' >> /etc/init.d/zram
114
+  echo '        echo "Usage: $0 {start|stop|restart}"' >> /etc/init.d/zram
115 115
   echo '        RETVAL=1' >> /etc/init.d/zram
116 116
   echo 'esac' >> /etc/init.d/zram
117 117
   echo 'exit $RETVAL' >> /etc/init.d/zram
@@ -180,16 +180,16 @@ function time_synchronisation {
180 180
   echo 'BEFORE=$(date -d "$Y-$M-$D" "+%s")' >> /usr/bin/updatedate
181 181
   echo 'BACKWARDS_BETWEEN=0' >> /usr/bin/updatedate
182 182
   echo '# If the date was previously set' >> /usr/bin/updatedate
183
-  echo 'if [[ -f \"$BEFORE_DATE_FILE\" ]]; then' >> /usr/bin/updatedate
183
+  echo 'if [[ -f "$BEFORE_DATE_FILE" ]]; then' >> /usr/bin/updatedate
184 184
   echo '    BEFORE_FILE=$(cat $BEFORE_DATE_FILE)' >> /usr/bin/updatedate
185 185
   echo '    BEFORE_FULLDATE=$(cat $BEFORE_FULLDATE_FILE)' >> /usr/bin/updatedate
186 186
   echo '    # is the date going backwards?' >> /usr/bin/updatedate
187 187
   echo '    if (( BEFORE_FILE > BEFORE )); then' >> /usr/bin/updatedate
188
-  echo '        echo -n \"Date went backwards between tlsdate updates. \" >> $LOGFILE' >> /usr/bin/updatedate
189
-  echo '        echo -n \"$BEFORE_FILE > $BEFORE, \" >> $LOGFILE' >> /usr/bin/updatedate
190
-  echo '        echo \"$BEFORE_FULLDATE > $DATE_BEFORE\" >> $LOGFILE' >> /usr/bin/updatedate
188
+  echo '        echo -n "Date went backwards between tlsdate updates. " >> $LOGFILE' >> /usr/bin/updatedate
189
+  echo '        echo -n "$BEFORE_FILE > $BEFORE, " >> $LOGFILE' >> /usr/bin/updatedate
190
+  echo '        echo "$BEFORE_FULLDATE > $DATE_BEFORE" >> $LOGFILE' >> /usr/bin/updatedate
191 191
   echo '        # Send a warning email' > /usr/bin/updatedate
192
-  echo '        echo $(tail $LOGFILE -n 2) | mail -s \"tlsdate anomaly\" $EMAIL' >> /usr/bin/updatedate
192
+  echo '        echo $(tail $LOGFILE -n 2) | mail -s "tlsdate anomaly" $EMAIL' >> /usr/bin/updatedate
193 193
   echo '        # Try another time source' >> /usr/bin/updatedate
194 194
   echo '        TIMESOURCE=$TIMESOURCE2' >> /usr/bin/updatedate
195 195
   echo '        # try running without any parameters' >> /usr/bin/updatedate
@@ -203,24 +203,24 @@ function time_synchronisation {
203 203
   echo 'AFTER=$(date -d "$Y-$M-$D" '+%s')' >> /usr/bin/updatedate
204 204
   echo '# After setting the date did it go backwards?' >> /usr/bin/updatedate
205 205
   echo 'if (( AFTER < BEFORE )); then' >> /usr/bin/updatedate
206
-  echo '    echo \"Incorrect date: $DATE_BEFORE -> $DATE_AFTER\" >> $LOGFILE' >> /usr/bin/updatedate
206
+  echo '    echo "Incorrect date: $DATE_BEFORE -> $DATE_AFTER" >> $LOGFILE' >> /usr/bin/updatedate
207 207
   echo '    # Send a warning email' >> /usr/bin/updatedate
208
-  echo '    echo $(tail $LOGFILE -n 2) | mail -s \"tlsdate anomaly\" $EMAIL' >> /usr/bin/updatedate
208
+  echo '    echo $(tail $LOGFILE -n 2) | mail -s "tlsdate anomaly" $EMAIL' >> /usr/bin/updatedate
209 209
   echo '    # Try resetting the date from another time source' >> /usr/bin/updatedate
210 210
   echo '    /usr/bin/timeout $TIMEOUT tlsdate -l -t -H $TIMESOURCE2 -p 443 >> $LOGFILE' >> /usr/bin/updatedate
211 211
   echo '    DATE_AFTER=$(date)' >> /usr/bin/updatedate
212 212
   echo '    AFTER=$(date -d "$Y-$M-$D" "+%s")' >> /usr/bin/updatedate
213 213
   echo 'else' >> /usr/bin/updatedate
214 214
   echo '    echo -n $TIMESOURCE >> $LOGFILE' >> /usr/bin/updatedate
215
-  echo '    if [[ -f \"$BEFORE_DATE_FILE\" ]]; then' >> /usr/bin/updatedate
215
+  echo '    if [[ -f "$BEFORE_DATE_FILE" ]]; then' >> /usr/bin/updatedate
216 216
   echo '        echo -n " " >> $LOGFILE' >> /usr/bin/updatedate
217 217
   echo '        echo -n $BEFORE_FILE >> $LOGFILE' >> /usr/bin/updatedate
218 218
   echo '    fi' >> /usr/bin/updatedate
219
-  echo '    echo -n \" \" >> $LOGFILE' >> /usr/bin/updatedate
219
+  echo '    echo -n " " >> $LOGFILE' >> /usr/bin/updatedate
220 220
   echo '    echo -n $BEFORE >> $LOGFILE' >> /usr/bin/updatedate
221
-  echo '    echo -n \" \" >> $LOGFILE' >> /usr/bin/updatedate
221
+  echo '    echo -n " " >> $LOGFILE' >> /usr/bin/updatedate
222 222
   echo '    echo -n $AFTER >> $LOGFILE' >> /usr/bin/updatedate
223
-  echo '    echo -n \" \" >> $LOGFILE' >> /usr/bin/updatedate
223
+  echo '    echo -n " " >> $LOGFILE' >> /usr/bin/updatedate
224 224
   echo '    echo $DATE_AFTER >> $LOGFILE' >> /usr/bin/updatedate
225 225
   echo 'fi' >> /usr/bin/updatedate
226 226
   echo '# Log the last date' >> /usr/bin/updatedate
@@ -344,7 +344,7 @@ function script_to_make_self_signed_certificates {
344 344
   echo '    echo "$0: openssl is not installed, exiting" 1>&2' >> /usr/bin/makecert
345 345
   echo '    exit 1' >> /usr/bin/makecert
346 346
   echo 'fi' >> /usr/bin/makecert
347
-  echo 'openssl req -x509 -nodes -days 3650 -sha256 -subj \"/O=$ORGANISATION/OU=$UNIT/C=$COUNTRY_CODE/ST=$AREA/L=$LOCATION/CN=$HOSTNAME\" -newkey rsa:4096 -keyout /etc/ssl/private/$HOSTNAME.key -out /etc/ssl/certs/$HOSTNAME.crt' >> /usr/bin/makecert
347
+  echo 'openssl req -x509 -nodes -days 3650 -sha256 -subj "/O=$ORGANISATION/OU=$UNIT/C=$COUNTRY_CODE/ST=$AREA/L=$LOCATION/CN=$HOSTNAME" -newkey rsa:4096 -keyout /etc/ssl/private/$HOSTNAME.key -out /etc/ssl/certs/$HOSTNAME.crt' >> /usr/bin/makecert
348 348
   echo 'openssl dhparam -check -text -5 1024 -out /etc/ssl/certs/$HOSTNAME.dhparam' >> /usr/bin/makecert
349 349
   echo 'chmod 400 /etc/ssl/private/$HOSTNAME.key' >> /usr/bin/makecert
350 350
   echo 'chmod 640 /etc/ssl/certs/$HOSTNAME.crt' >> /usr/bin/makecert
@@ -487,7 +487,7 @@ function spam_filtering {
487 487
   echo 'for f in `ls $MAILDIR/cur`' >> /usr/bin/filterspam
488 488
   echo 'do' >> /usr/bin/filterspam
489 489
   echo '    spamc -L spam < "$MAILDIR/cur/$f" > /dev/null' >> /usr/bin/filterspam
490
-  echo '    rm \"$MAILDIR/cur/$f\"' >> /usr/bin/filterspam
490
+  echo '    rm "$MAILDIR/cur/$f"' >> /usr/bin/filterspam
491 491
   echo 'done' >> /usr/bin/filterspam
492 492
   echo 'for f in `ls $MAILDIR/new`' >> /usr/bin/filterspam
493 493
   echo 'do' >> /usr/bin/filterspam
@@ -569,10 +569,10 @@ function email_client {
569 569
   echo 'set editor="emacs"' >> /etc/Muttrc
570 570
   echo 'set header_cache="+.cache"' >> /etc/Muttrc
571 571
   echo '' >> /etc/Muttrc
572
-  echo 'macro index S \"<tag-prefix><save-message>=.learn-spam<enter>\" \"move to learn-spam\"' >> /etc/Muttrc
573
-  echo 'macro pager S \"<save-message>=.learn-spam<enter>\" \"move to learn-spam\"' >> /etc/Muttrc
574
-  echo 'macro index H \"<tag-prefix><copy-message>=.learn-ham<enter>\" \"copy to learn-ham\"' >> /etc/Muttrc
575
-  echo 'macro pager H \"<copy-message>=.learn-ham<enter>\" \"copy to learn-ham\"' >> /etc/Muttrc
572
+  echo 'macro index S "<tag-prefix><save-message>=.learn-spam<enter>" "move to learn-spam"' >> /etc/Muttrc
573
+  echo 'macro pager S "<save-message>=.learn-spam<enter>" "move to learn-spam"' >> /etc/Muttrc
574
+  echo 'macro index H "<tag-prefix><copy-message>=.learn-ham<enter>" "copy to learn-ham"' >> /etc/Muttrc
575
+  echo 'macro pager H "<copy-message>=.learn-ham<enter>" "copy to learn-ham"' >> /etc/Muttrc
576 576
   echo '' >> /etc/Muttrc
577 577
   echo '# set up the sidebar' >> /etc/Muttrc
578 578
   echo 'set sidebar_width=12' >> /etc/Muttrc
@@ -605,22 +605,22 @@ function email_client {
605 605
   echo 'bind pager \Co sidebar-open' >> /etc/Muttrc
606 606
   echo '' >> /etc/Muttrc
607 607
   echo '# ctrl-b toggles sidebar visibility' >> /etc/Muttrc
608
-  echo "macro index,pager \Cb '<enter-command>toggle sidebar_visible<enter><redraw-screen>' \"toggle sidebar\"" >> /etc/Muttrc
608
+  echo "macro index,pager \Cb '<enter-command>toggle sidebar_visible<enter><redraw-screen>' 'toggle sidebar'" >> /etc/Muttrc
609 609
   echo '' >> /etc/Muttrc
610 610
   echo '# esc-m Mark new messages as read' >> /etc/Muttrc
611
-  echo "macro index <esc>m \"T~N<enter>;WNT~O<enter>;WO\CT~T<enter>\" \"mark all messages read\"" >> /etc/Muttrc
611
+  echo 'macro index <esc>m "T~N<enter>;WNT~O<enter>;WO\CT~T<enter>" "mark all messages read"' >> /etc/Muttrc
612 612
   echo '' >> /etc/Muttrc
613 613
   echo '# Collapsing threads' >> /etc/Muttrc
614
-  echo "macro index [ \"<collapse-thread>\" \"collapse/uncollapse thread\"" >> /etc/Muttrc
615
-  echo "macro index ] \"<collapse-all>\"    \"collapse/uncollapse all threads\"" >> /etc/Muttrc
614
+  echo 'macro index [ "<collapse-thread>" "collapse/uncollapse thread"' >> /etc/Muttrc
615
+  echo 'macro index ] "<collapse-all>"    "collapse/uncollapse all threads"' >> /etc/Muttrc
616 616
   echo '' >> /etc/Muttrc
617 617
   echo '# threads containing new messages' >> /etc/Muttrc
618
-  echo "uncolor index \"~(~N)\"" >> /etc/Muttrc
619
-  echo "color index brightblue default \"~(~N)\"" >> /etc/Muttrc
618
+  echo 'uncolor index "~(~N)"' >> /etc/Muttrc
619
+  echo 'color index brightblue default "~(~N)"' >> /etc/Muttrc
620 620
   echo '' >> /etc/Muttrc
621 621
   echo '# new messages themselves' >> /etc/Muttrc
622
-  echo "uncolor index \"~N\"" >> /etc/Muttrc
623
-  echo "color index brightyellow default \"~N\"" >> /etc/Muttrc
622
+  echo 'uncolor index "~N"' >> /etc/Muttrc
623
+  echo 'color index brightyellow default "~N"' >> /etc/Muttrc
624 624
   echo '' >> /etc/Muttrc
625 625
   echo '# GPG/PGP integration' >> /etc/Muttrc
626 626
   echo '# this set the number of seconds to keep in memory the passphrase used to encrypt/sign' >> /etc/Muttrc
@@ -635,7 +635,7 @@ function email_client {
635 635
   echo '' >> /etc/Muttrc
636 636
   echo 'set alias_file=~/.mutt-alias' >> /etc/Muttrc
637 637
   echo 'source ~/.mutt-alias' >> /etc/Muttrc
638
-  echo "set query_command= \"abook --mutt-query '%s'\"" >> /etc/Muttrc
638
+  echo 'set query_command= "abook --mutt-query \"%s\""' >> /etc/Muttrc
639 639
   echo 'macro index,pager A "<pipe-message>abook --add-email-quiet<return>" "add the sender address to abook"' >> /etc/Muttrc
640 640
 
641 641
   cp -f /etc/Muttrc /home/$MY_USERNAME/.muttrc