浏览代码

Checking of restarts

Bob Mottram 10 年前
父节点
当前提交
b584239333
共有 1 个文件被更改,包括 21 次插入2 次删除
  1. 21
    2
      install-freedombone.sh

+ 21
- 2
install-freedombone.sh 查看文件

7132
   fi
7132
   fi
7133
   apt-get -y install hostapd dnsmasq
7133
   apt-get -y install hostapd dnsmasq
7134
 
7134
 
7135
+  if [ ! -f /etc/default/hostapd ]; then
7136
+	  echo 'Unable to find /etc/default/hostapd. hostapd may not have installed correctly'
7137
+	  exit 490
7138
+  fi
7139
+  if [ ! -f /etc/dnsmasq.conf ]; then
7140
+	  echo 'Unable to find /etc/dnsmasq.conf. dnsmasq may not have installed correctly'
7141
+	  exit 492
7142
+  fi
7143
+
7135
   get_wifi_essid
7144
   get_wifi_essid
7136
   get_wifi_password
7145
   get_wifi_password
7137
 
7146
 
7188
   echo 'eapol_key_index_workaround=0' >> /etc/hostapd/hostapd.conf
7197
   echo 'eapol_key_index_workaround=0' >> /etc/hostapd/hostapd.conf
7189
 
7198
 
7190
   service hostapd restart
7199
   service hostapd restart
7200
+  if [ ! "$?" = "0" ]; then
7201
+	  echo 'Unable to restart hostapd'
7202
+	  exit 854
7203
+  fi
7191
 
7204
 
7192
   sed -i "s/#interface=/interface=$WIFI_INTERFACE/" /etc/dnsmasq.conf
7205
   sed -i "s/#interface=/interface=$WIFI_INTERFACE/" /etc/dnsmasq.conf
7193
   sed -i 's/#dhcp-range=192.168.0.50,192.168.0.150,12h/dhcp-range=192.168.1.1,192.168.1.50,12h/g' /etc/dnsmasq.conf
7206
   sed -i 's/#dhcp-range=192.168.0.50,192.168.0.150,12h/dhcp-range=192.168.1.1,192.168.1.50,12h/g' /etc/dnsmasq.conf
7194
 
7207
 
7195
   service dnsmasq restart
7208
   service dnsmasq restart
7209
+  if [ ! "$?" = "0" ]; then
7210
+	  echo 'Unable to restart dnsmasq'
7211
+	  exit 856
7212
+  fi
7196
 
7213
 
7197
   # Add details to the README file
7214
   # Add details to the README file
7198
   if ! grep -q "Wifi Hotspot" /home/$MY_USERNAME/README; then
7215
   if ! grep -q "Wifi Hotspot" /home/$MY_USERNAME/README; then
7205
       chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
7222
       chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
7206
   fi
7223
   fi
7207
 
7224
 
7208
-  service networking restart
7209
-
7210
   echo 'enable_wifi_hotspot' >> $COMPLETION_FILE
7225
   echo 'enable_wifi_hotspot' >> $COMPLETION_FILE
7211
 }
7226
 }
7212
 
7227
 
7242
   fi
7257
   fi
7243
 
7258
 
7244
   service networking restart
7259
   service networking restart
7260
+  if [ ! "$?" = "0" ]; then
7261
+	  echo 'Unable to restart networking'
7262
+	  exit 855
7263
+  fi
7245
 
7264
 
7246
   # Add details to the README file
7265
   # Add details to the README file
7247
   if [[ ENABLE_WIFI_HOTSPOT != "yes" ]]; then
7266
   if [[ ENABLE_WIFI_HOTSPOT != "yes" ]]; then