Pārlūkot izejas kodu

Don't need square brackets

Bob Mottram 10 gadus atpakaļ
vecāks
revīzija
cfdf5858c6
1 mainītis faili ar 23 papildinājumiem un 23 dzēšanām
  1. 23
    23
      install-freedombone.sh

+ 23
- 23
install-freedombone.sh Parādīt failu

31
 }
31
 }
32
 
32
 
33
 function remove_proprietary_repos {
33
 function remove_proprietary_repos {
34
-  if [ grep -Fxq "remove_proprietary_repos" $COMPLETION_FILE ]; then
34
+  if grep -Fxq "remove_proprietary_repos" $COMPLETION_FILE; then
35
 	  return
35
 	  return
36
   fi
36
   fi
37
   sed -i 's/ non-free//g' /etc/apt/sources.list
37
   sed -i 's/ non-free//g' /etc/apt/sources.list
39
 }
39
 }
40
 
40
 
41
 function initial_setup {
41
 function initial_setup {
42
-  if [ grep -Fxq "initial_setup" $COMPLETION_FILE ]; then
42
+  if grep -Fxq "initial_setup" $COMPLETION_FILE; then
43
 	  return
43
 	  return
44
   fi
44
   fi
45
   apt-get -y update
45
   apt-get -y update
49
 }
49
 }
50
 
50
 
51
 function install_editor {
51
 function install_editor {
52
-  if [ grep -Fxq "install_editor" $COMPLETION_FILE ]; then
52
+  if grep -Fxq "install_editor" $COMPLETION_FILE; then
53
 	  return
53
 	  return
54
   fi
54
   fi
55
   update-alternatives --set editor /usr/bin/emacs24
55
   update-alternatives --set editor /usr/bin/emacs24
57
 }
57
 }
58
 
58
 
59
 function enable_backports {
59
 function enable_backports {
60
-  if [ grep -Fxq "enable_backports" $COMPLETION_FILE ]; then
60
+  if grep -Fxq "enable_backports" $COMPLETION_FILE; then
61
 	  return
61
 	  return
62
   fi
62
   fi
63
   echo "deb http://ftp.us.debian.org/debian jessie-backports main" >> /etc/apt/sources.list
63
   echo "deb http://ftp.us.debian.org/debian jessie-backports main" >> /etc/apt/sources.list
65
 }
65
 }
66
 
66
 
67
 function update_the_kernel {
67
 function update_the_kernel {
68
-  if [ grep -Fxq "update_the_kernel" $COMPLETION_FILE ]; then
68
+  if grep -Fxq "update_the_kernel" $COMPLETION_FILE; then
69
 	  return
69
 	  return
70
   fi
70
   fi
71
   cd /opt/scripts/tools
71
   cd /opt/scripts/tools
74
 }
74
 }
75
 
75
 
76
 function enable_zram {
76
 function enable_zram {
77
-  if [ grep -Fxq "enable_zram" $COMPLETION_FILE ]; then
77
+  if grep -Fxq "enable_zram" $COMPLETION_FILE; then
78
 	  return
78
 	  return
79
   fi
79
   fi
80
   echo "options zram num_devices=1" >> /etc/modprobe.d/zram.conf
80
   echo "options zram num_devices=1" >> /etc/modprobe.d/zram.conf
151
 }
151
 }
152
 
152
 
153
 function random_number_generator {
153
 function random_number_generator {
154
-  if [ grep -Fxq "random_number_generator" $COMPLETION_FILE ]; then
154
+  if grep -Fxq "random_number_generator" $COMPLETION_FILE; then
155
 	  return
155
 	  return
156
   fi
156
   fi
157
   if [ $USE_HWRNG == "yes" ]; then
157
   if [ $USE_HWRNG == "yes" ]; then
166
 }
166
 }
167
 
167
 
168
 function configure_ssh {
168
 function configure_ssh {
169
-  if [ grep -Fxq "configure_ssh" $COMPLETION_FILE ]; then
169
+  if grep -Fxq "configure_ssh" $COMPLETION_FILE; then
170
 	  return
170
 	  return
171
   fi
171
   fi
172
   sed -i "s/Port 22/Port $SSH_PORT/g" /etc/ssh/sshd_config
172
   sed -i "s/Port 22/Port $SSH_PORT/g" /etc/ssh/sshd_config
187
 }
187
 }
188
 
188
 
189
 function regenerate_ssh_keys {
189
 function regenerate_ssh_keys {
190
-  if [ grep -Fxq "regenerate_ssh_keys" $COMPLETION_FILE ]; then
190
+  if grep -Fxq "regenerate_ssh_keys" $COMPLETION_FILE; then
191
 	  return
191
 	  return
192
   fi
192
   fi
193
   rm -f /etc/ssh/ssh_host_*
193
   rm -f /etc/ssh/ssh_host_*
197
 }
197
 }
198
 
198
 
199
 function set_your_domain_name {
199
 function set_your_domain_name {
200
-  if [ grep -Fxq "set_your_domain_name" $COMPLETION_FILE ]; then
200
+  if grep -Fxq "set_your_domain_name" $COMPLETION_FILE; then
201
 	  return
201
 	  return
202
   fi
202
   fi
203
   echo "$DOMAIN_NAME" > /etc/hostname
203
   echo "$DOMAIN_NAME" > /etc/hostname
207
 }
207
 }
208
 
208
 
209
 function time_synchronisation {
209
 function time_synchronisation {
210
-  if [ grep -Fxq "time_synchronisation" $COMPLETION_FILE ]; then
210
+  if grep -Fxq "time_synchronisation" $COMPLETION_FILE; then
211
 	  return
211
 	  return
212
   fi
212
   fi
213
   apt-get -y install build-essential automake git pkg-config autoconf libtool libssl-dev
213
   apt-get -y install build-essential automake git pkg-config autoconf libtool libssl-dev
330
 }
330
 }
331
 
331
 
332
 function configure_firewall {
332
 function configure_firewall {
333
-  if [ grep -Fxq "configure_firewall" $COMPLETION_FILE ]; then
333
+  if grep -Fxq "configure_firewall" $COMPLETION_FILE; then
334
 	  return
334
 	  return
335
   fi
335
   fi
336
   iptables -P INPUT ACCEPT
336
   iptables -P INPUT ACCEPT
354
 }
354
 }
355
 
355
 
356
 function configure_firewall_for_ssh {
356
 function configure_firewall_for_ssh {
357
-  if [ grep -Fxq "configure_firewall_for_ssh" $COMPLETION_FILE ]; then
357
+  if grep -Fxq "configure_firewall_for_ssh" $COMPLETION_FILE; then
358
 	  return
358
 	  return
359
   fi
359
   fi
360
   iptables -A INPUT -i eth0 -p tcp --dport $SSH_PORT -j ACCEPT
360
   iptables -A INPUT -i eth0 -p tcp --dport $SSH_PORT -j ACCEPT
363
 }
363
 }
364
 
364
 
365
 function configure_firewall_for_email {
365
 function configure_firewall_for_email {
366
-  if [ grep -Fxq "configure_firewall_for_email" $COMPLETION_FILE ]; then
366
+  if grep -Fxq "configure_firewall_for_email" $COMPLETION_FILE; then
367
 	  return
367
 	  return
368
   fi
368
   fi
369
   iptables -A INPUT -i eth0 -p tcp --dport 25 -j ACCEPT
369
   iptables -A INPUT -i eth0 -p tcp --dport 25 -j ACCEPT
375
 }
375
 }
376
 
376
 
377
 function configure_internet_protocol {
377
 function configure_internet_protocol {
378
-  if [ grep -Fxq "configure_internet_protocol" $COMPLETION_FILE ]; then
378
+  if grep -Fxq "configure_internet_protocol" $COMPLETION_FILE; then
379
 	  return
379
 	  return
380
   fi
380
   fi
381
   sed -i "s/#net.ipv4.tcp_syncookies=1/net.ipv4.tcp_syncookies=1/g" /etc/sysctl.conf
381
   sed -i "s/#net.ipv4.tcp_syncookies=1/net.ipv4.tcp_syncookies=1/g" /etc/sysctl.conf
403
 }
403
 }
404
 
404
 
405
 function script_to_make_self_signed_certificates {
405
 function script_to_make_self_signed_certificates {
406
-  if [ grep -Fxq "script_to_make_self_signed_certificates" $COMPLETION_FILE ]; then
406
+  if grep -Fxq "script_to_make_self_signed_certificates" $COMPLETION_FILE; then
407
 	  return
407
 	  return
408
   fi
408
   fi
409
   echo '#!/bin/bash' > /usr/bin/makecert
409
   echo '#!/bin/bash' > /usr/bin/makecert
437
 }
437
 }
438
 
438
 
439
 function configure_email {
439
 function configure_email {
440
-  if [ grep -Fxq "configure_email" $COMPLETION_FILE ]; then
440
+  if grep -Fxq "configure_email" $COMPLETION_FILE; then
441
 	  return
441
 	  return
442
   fi
442
   fi
443
   apt-get -y remove postfix
443
   apt-get -y remove postfix
516
 }
516
 }
517
 
517
 
518
 function spam_filtering {
518
 function spam_filtering {
519
-  if [ grep -Fxq "spam_filtering" $COMPLETION_FILE ]; then
519
+  if grep -Fxq "spam_filtering" $COMPLETION_FILE; then
520
 	  return
520
 	  return
521
   fi
521
   fi
522
   apt-get -y install spamassassin exim4-daemon-heavy
522
   apt-get -y install spamassassin exim4-daemon-heavy
606
 }
606
 }
607
 
607
 
608
 function configure_imap {
608
 function configure_imap {
609
-  if [ grep -Fxq "configure_imap" $COMPLETION_FILE ]; then
609
+  if grep -Fxq "configure_imap" $COMPLETION_FILE; then
610
 	  return
610
 	  return
611
   fi
611
   fi
612
   apt-get -y install dovecot-common dovecot-imapd
612
   apt-get -y install dovecot-common dovecot-imapd
631
 }
631
 }
632
 
632
 
633
 function configure_gpg {
633
 function configure_gpg {
634
-  if [ grep -Fxq "configure_gpg" $COMPLETION_FILE ]; then
634
+  if grep -Fxq "configure_gpg" $COMPLETION_FILE; then
635
 	  return
635
 	  return
636
   fi
636
   fi
637
   apt-get -y install gnupg
637
   apt-get -y install gnupg
639
 }
639
 }
640
 
640
 
641
 function email_client {
641
 function email_client {
642
-  if [ grep -Fxq "email_client" $COMPLETION_FILE ]; then
642
+  if grep -Fxq "email_client" $COMPLETION_FILE; then
643
 	  return
643
 	  return
644
   fi
644
   fi
645
   apt-get -y install mutt-patched lynx abook
645
   apt-get -y install mutt-patched lynx abook
740
 }
740
 }
741
 
741
 
742
 function folders_for_mailing_lists {
742
 function folders_for_mailing_lists {
743
-  if [ grep -Fxq "folders_for_mailing_lists" $COMPLETION_FILE ]; then
743
+  if grep -Fxq "folders_for_mailing_lists" $COMPLETION_FILE; then
744
 	  return
744
 	  return
745
   fi
745
   fi
746
   echo '#!/bin/bash' > /usr/bin/mailinglistrule
746
   echo '#!/bin/bash' > /usr/bin/mailinglistrule
776
 }
776
 }
777
 
777
 
778
 function folders_for_email_addresses {
778
 function folders_for_email_addresses {
779
-  if [ grep -Fxq "folders_for_email_addresses" $COMPLETION_FILE ]; then
779
+  if grep -Fxq "folders_for_email_addresses" $COMPLETION_FILE; then
780
 	  return
780
 	  return
781
   fi
781
   fi
782
   echo '#!/bin/bash' > /usr/bin/emailrule
782
   echo '#!/bin/bash' > /usr/bin/emailrule