瀏覽代碼

Check that installs succeed

Bob Mottram 11 年之前
父節點
當前提交
1f6cca6f69
共有 1 個檔案被更改,包括 55 行新增4 行删除
  1. 55
    4
      install-freedombone.sh

+ 55
- 4
install-freedombone.sh 查看文件

238
 # list of ciphers to use
238
 # list of ciphers to use
239
 SSL_CIPHERS="EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA"
239
 SSL_CIPHERS="EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA"
240
 
240
 
241
+# message if something fails to install
242
+CHECK_MESSAGE="Check your internet connection, /etc/network/interfaces and /etc/resolv.conf"
243
+
241
 export DEBIAN_FRONTEND=noninteractive
244
 export DEBIAN_FRONTEND=noninteractive
242
 
245
 
243
 # File which keeps track of what has already been installed
246
 # File which keeps track of what has already been installed
1066
   fi
1069
   fi
1067
   apt-get -y remove postfix
1070
   apt-get -y remove postfix
1068
   apt-get -y --force-yes install exim4 sasl2-bin swaks libnet-ssleay-perl procmail
1071
   apt-get -y --force-yes install exim4 sasl2-bin swaks libnet-ssleay-perl procmail
1072
+
1073
+  if [ ! -d /etc/exim4 ]; then
1074
+      echo "ERROR: Exim does not appear to have installed. $CHECK_MESSAGE"
1075
+      exit 48
1076
+  fi
1077
+
1069
   echo 'dc_eximconfig_configtype="internet"' > /etc/exim4/update-exim4.conf.conf
1078
   echo 'dc_eximconfig_configtype="internet"' > /etc/exim4/update-exim4.conf.conf
1070
   echo "dc_other_hostnames='$DOMAIN_NAME'" >> /etc/exim4/update-exim4.conf.conf
1079
   echo "dc_other_hostnames='$DOMAIN_NAME'" >> /etc/exim4/update-exim4.conf.conf
1071
   echo "dc_local_interfaces=''" >> /etc/exim4/update-exim4.conf.conf
1080
   echo "dc_local_interfaces=''" >> /etc/exim4/update-exim4.conf.conf
1253
       return
1262
       return
1254
   fi
1263
   fi
1255
   apt-get -y --force-yes install dovecot-common dovecot-imapd
1264
   apt-get -y --force-yes install dovecot-common dovecot-imapd
1265
+
1266
+  if [ ! -d /etc/dovecot ]; then
1267
+      echo "ERROR: Dovecot does not appear to have installed. $CHECK_MESSAGE"
1268
+      exit 48
1269
+  fi
1270
+
1256
   if [ ! -f /etc/ssl/private/dovecot.key ]; then
1271
   if [ ! -f /etc/ssl/private/dovecot.key ]; then
1257
       makecert dovecot
1272
       makecert dovecot
1258
   fi
1273
   fi
1350
       return
1365
       return
1351
   fi
1366
   fi
1352
   apt-get -y --force-yes install mutt-patched lynx abook
1367
   apt-get -y --force-yes install mutt-patched lynx abook
1368
+
1369
+  if [ ! -f /etc/Muttrc ]; then
1370
+      echo "ERROR: Mutt does not appear to have installed. $CHECK_MESSAGE"
1371
+      exit 49
1372
+  fi
1373
+
1353
   if [ ! -d /home/$MY_USERNAME/.mutt ]; then
1374
   if [ ! -d /home/$MY_USERNAME/.mutt ]; then
1354
     mkdir /home/$MY_USERNAME/.mutt
1375
     mkdir /home/$MY_USERNAME/.mutt
1355
   fi
1376
   fi
1682
   fi
1703
   fi
1683
   # install nginx
1704
   # install nginx
1684
   apt-get -y --force-yes install nginx php5-fpm git
1705
   apt-get -y --force-yes install nginx php5-fpm git
1706
+
1707
+  if [ ! -d /etc/nginx ]; then
1708
+      echo "ERROR: nginx does not appear to have installed. $CHECK_MESSAGE"
1709
+      exit 51
1710
+  fi
1711
+
1685
   # install a script to easily enable and disable nginx virtual hosts
1712
   # install a script to easily enable and disable nginx virtual hosts
1686
   if [ ! -d $INSTALL_DIR ]; then
1713
   if [ ! -d $INSTALL_DIR ]; then
1687
       mkdir $INSTALL_DIR
1714
       mkdir $INSTALL_DIR
1902
       return
1929
       return
1903
   fi
1930
   fi
1904
   apt-get -y --force-yes install prosody
1931
   apt-get -y --force-yes install prosody
1932
+
1933
+  if [ ! -d /etc/prosody ]; then
1934
+      echo "ERROR: prosody does not appear to have installed. $CHECK_MESSAGE"
1935
+      exit 52
1936
+  fi
1937
+
1905
   if [ ! -f "/etc/ssl/private/xmpp.key" ]; then
1938
   if [ ! -f "/etc/ssl/private/xmpp.key" ]; then
1906
       makecert xmpp
1939
       makecert xmpp
1907
   fi
1940
   fi
1971
       return
2004
       return
1972
   fi
2005
   fi
1973
   apt-get -y --force-yes install ngircd
2006
   apt-get -y --force-yes install ngircd
2007
+
2008
+  if [ ! -d /etc/ngircd ]; then
2009
+      echo "ERROR: ngircd does not appear to have installed. $CHECK_MESSAGE"
2010
+      exit 53
2011
+  fi
2012
+
1974
   if [ ! "/etc/ssl/private/ngircd.key" ]; then
2013
   if [ ! "/etc/ssl/private/ngircd.key" ]; then
1975
       makecert ngircd
2014
       makecert ngircd
1976
   fi
2015
   fi
2382
   debconf-set-selections <<< "mariadb-server mariadb-server/root_password password $MARIADB_PASSWORD"
2421
   debconf-set-selections <<< "mariadb-server mariadb-server/root_password password $MARIADB_PASSWORD"
2383
   debconf-set-selections <<< "mariadb-server mariadb-server/root_password_again password $MARIADB_PASSWORD"
2422
   debconf-set-selections <<< "mariadb-server mariadb-server/root_password_again password $MARIADB_PASSWORD"
2384
   apt-get -y --force-yes install mariadb-server
2423
   apt-get -y --force-yes install mariadb-server
2424
+
2425
+  if [ ! -d /etc/mysql ]; then
2426
+      echo "ERROR: mariadb-server does not appear to have installed. $CHECK_MESSAGE"
2427
+      exit 54
2428
+  fi
2429
+
2385
   mysqladmin -u root password "$MARIADB_PASSWORD"
2430
   mysqladmin -u root password "$MARIADB_PASSWORD"
2386
   echo 'install_mariadb' >> $COMPLETION_FILE
2431
   echo 'install_mariadb' >> $COMPLETION_FILE
2387
 }
2432
 }
2859
       return
2904
       return
2860
   fi
2905
   fi
2861
   apt-get -y --force-yes install minidlna
2906
   apt-get -y --force-yes install minidlna
2907
+
2908
+  if [ ! -f /etc/minidlna.conf ]; then
2909
+      echo "ERROR: minidlna does not appear to have installed. $CHECK_MESSAGE"
2910
+      exit 55
2911
+  fi
2912
+
2862
   sed -i "s|media_dir=/var/lib/minidlna|media_dir=A,/home/$MY_USERNAME/Music|g" /etc/minidlna.conf
2913
   sed -i "s|media_dir=/var/lib/minidlna|media_dir=A,/home/$MY_USERNAME/Music|g" /etc/minidlna.conf
2863
   if ! grep -q "/home/$MY_USERNAME/Pictures" /etc/minidlna.conf; then
2914
   if ! grep -q "/home/$MY_USERNAME/Pictures" /etc/minidlna.conf; then
2864
     echo "media_dir=P,/home/$MY_USERNAME/Pictures" >> /etc/minidlna.conf
2915
     echo "media_dir=P,/home/$MY_USERNAME/Pictures" >> /etc/minidlna.conf
3093
   apt-get -y --force-yes install obnam bcrypt
3144
   apt-get -y --force-yes install obnam bcrypt
3094
 
3145
 
3095
   if [ ! -d /etc/obnam ]; then
3146
   if [ ! -d /etc/obnam ]; then
3096
-	  echo 'obnam may not have installed correctly. Check your internet connection, /etc/network/interfaces and /etc/resolv.conf'
3097
-	  exit 46
3147
+      echo "ERROR: obnam may not have installed correctly. $CHECK_MESSAGE"
3148
+      exit 46
3098
   fi
3149
   fi
3099
 
3150
 
3100
   echo '#!/bin/bash' > /usr/bin/$BACKUP_SCRIPT_NAME
3151
   echo '#!/bin/bash' > /usr/bin/$BACKUP_SCRIPT_NAME
3215
   apt-get -y --force-yes install obnam bcrypt
3266
   apt-get -y --force-yes install obnam bcrypt
3216
 
3267
 
3217
   if [ ! -d /etc/obnam ]; then
3268
   if [ ! -d /etc/obnam ]; then
3218
-	  echo 'obnam may not have installed correctly. Check your internet connection, /etc/network/interfaces and /etc/resolv.conf'
3219
-	  exit 47
3269
+      echo 'obnam may not have installed correctly. Check your internet connection, /etc/network/interfaces and /etc/resolv.conf'
3270
+      exit 47
3220
   fi
3271
   fi
3221
 
3272
 
3222
   echo '#!/bin/bash' > /usr/bin/$RESTORE_SCRIPT_NAME
3273
   echo '#!/bin/bash' > /usr/bin/$RESTORE_SCRIPT_NAME