Selaa lähdekoodia

Check that installs succeed

Bob Mottram 10 vuotta sitten
vanhempi
commit
1f6cca6f69
1 muutettua tiedostoa jossa 55 lisäystä ja 4 poistoa
  1. 55
    4
      install-freedombone.sh

+ 55
- 4
install-freedombone.sh Näytä tiedosto

@@ -238,6 +238,9 @@ SSL_PROTOCOLS="TLSv1 TLSv1.1 TLSv1.2"
238 238
 # list of ciphers to use
239 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 244
 export DEBIAN_FRONTEND=noninteractive
242 245
 
243 246
 # File which keeps track of what has already been installed
@@ -1066,6 +1069,12 @@ function configure_email {
1066 1069
   fi
1067 1070
   apt-get -y remove postfix
1068 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 1078
   echo 'dc_eximconfig_configtype="internet"' > /etc/exim4/update-exim4.conf.conf
1070 1079
   echo "dc_other_hostnames='$DOMAIN_NAME'" >> /etc/exim4/update-exim4.conf.conf
1071 1080
   echo "dc_local_interfaces=''" >> /etc/exim4/update-exim4.conf.conf
@@ -1253,6 +1262,12 @@ function configure_imap {
1253 1262
       return
1254 1263
   fi
1255 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 1271
   if [ ! -f /etc/ssl/private/dovecot.key ]; then
1257 1272
       makecert dovecot
1258 1273
   fi
@@ -1350,6 +1365,12 @@ function email_client {
1350 1365
       return
1351 1366
   fi
1352 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 1374
   if [ ! -d /home/$MY_USERNAME/.mutt ]; then
1354 1375
     mkdir /home/$MY_USERNAME/.mutt
1355 1376
   fi
@@ -1682,6 +1703,12 @@ function install_web_server {
1682 1703
   fi
1683 1704
   # install nginx
1684 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 1712
   # install a script to easily enable and disable nginx virtual hosts
1686 1713
   if [ ! -d $INSTALL_DIR ]; then
1687 1714
       mkdir $INSTALL_DIR
@@ -1902,6 +1929,12 @@ function install_xmpp {
1902 1929
       return
1903 1930
   fi
1904 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 1938
   if [ ! -f "/etc/ssl/private/xmpp.key" ]; then
1906 1939
       makecert xmpp
1907 1940
   fi
@@ -1971,6 +2004,12 @@ function install_irc_server {
1971 2004
       return
1972 2005
   fi
1973 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 2013
   if [ ! "/etc/ssl/private/ngircd.key" ]; then
1975 2014
       makecert ngircd
1976 2015
   fi
@@ -2382,6 +2421,12 @@ function install_mariadb {
2382 2421
   debconf-set-selections <<< "mariadb-server mariadb-server/root_password password $MARIADB_PASSWORD"
2383 2422
   debconf-set-selections <<< "mariadb-server mariadb-server/root_password_again password $MARIADB_PASSWORD"
2384 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 2430
   mysqladmin -u root password "$MARIADB_PASSWORD"
2386 2431
   echo 'install_mariadb' >> $COMPLETION_FILE
2387 2432
 }
@@ -2859,6 +2904,12 @@ function install_dlna_server {
2859 2904
       return
2860 2905
   fi
2861 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 2913
   sed -i "s|media_dir=/var/lib/minidlna|media_dir=A,/home/$MY_USERNAME/Music|g" /etc/minidlna.conf
2863 2914
   if ! grep -q "/home/$MY_USERNAME/Pictures" /etc/minidlna.conf; then
2864 2915
     echo "media_dir=P,/home/$MY_USERNAME/Pictures" >> /etc/minidlna.conf
@@ -3093,8 +3144,8 @@ function create_backup_script {
3093 3144
   apt-get -y --force-yes install obnam bcrypt
3094 3145
 
3095 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 3149
   fi
3099 3150
 
3100 3151
   echo '#!/bin/bash' > /usr/bin/$BACKUP_SCRIPT_NAME
@@ -3215,8 +3266,8 @@ function create_restore_script {
3215 3266
   apt-get -y --force-yes install obnam bcrypt
3216 3267
 
3217 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 3271
   fi
3221 3272
 
3222 3273
   echo '#!/bin/bash' > /usr/bin/$RESTORE_SCRIPT_NAME