More wifi fixing

This commit is contained in:
Bob Mottram 2014-12-25 17:25:14 +00:00
parent f16ca11b61
commit 9160421e7a
1 changed files with 5 additions and 5 deletions

View File

@ -7156,12 +7156,12 @@ function enable_wifi_hotspot {
# Create an ESSID if one doesn't exist # Create an ESSID if one doesn't exist
if [ ! $WIFI_ESSID ]; then if [ ! $WIFI_ESSID ]; then
TEMP_WIFI_ESSID="Freedom"$(openssl rand -base64 8) TEMP_WIFI_ESSID="Freedom"$(openssl rand -base64 8)
WIFI_ESSID=${$TEMP_WIFI_ESSID:0:3} WIFI_ESSID=${TEMP_WIFI_ESSID:0:3}
fi fi
# Add a password # Add a password
if [ ! $WIFI_PASSWORD ]; then if [ ! $WIFI_PASSWORD ]; then
TEMP_WIFI_PASSWORD=$(openssl rand -base64 8) TEMP_WIFI_PASSWORD=$(openssl rand -base64 8)
WIFI_PASSWORD=${$TEMP_WIFI_PASSWORD:0:8} WIFI_PASSWORD=${TEMP_WIFI_PASSWORD:0:8}
fi fi
sed -i 's|#DAEMON_CONF=.*|DAEMON_CONF="/etc/hostapd/hostapd.conf"|g' /etc/default/hostapd sed -i 's|#DAEMON_CONF=.*|DAEMON_CONF="/etc/hostapd/hostapd.conf"|g' /etc/default/hostapd
@ -7214,7 +7214,7 @@ function enable_wifi_hotspot {
exit 854 exit 854
fi fi
if ! grep -q "subnet 192.168.4.0 netmask 255.255.255.0" $COMPLETION_FILE; then if ! grep -q "subnet 192.168.4.0 netmask 255.255.255.0" /etc/dhcp/dhcpd.conf; then
echo '' >> /etc/dhcp/dhcpd.conf echo '' >> /etc/dhcp/dhcpd.conf
echo 'subnet 192.168.4.0 netmask 255.255.255.0 {' >> /etc/dhcp/dhcpd.conf echo 'subnet 192.168.4.0 netmask 255.255.255.0 {' >> /etc/dhcp/dhcpd.conf
echo ' range 192.168.4.2 192.168.4.10;' >> /etc/dhcp/dhcpd.conf echo ' range 192.168.4.2 192.168.4.10;' >> /etc/dhcp/dhcpd.conf
@ -7264,13 +7264,13 @@ function enable_wifi {
# Create an ESSID if one doesn't exist # Create an ESSID if one doesn't exist
if [ ! $WIFI_ESSID ]; then if [ ! $WIFI_ESSID ]; then
TEMP_WIFI_ESSID="Freedom"$(openssl rand -base64 8) TEMP_WIFI_ESSID="Freedom"$(openssl rand -base64 8)
WIFI_ESSID=${$TEMP_WIFI_ESSID:0:3} WIFI_ESSID=${TEMP_WIFI_ESSID:0:3}
fi fi
sed -i "s/essid/$WIFI_ESSID/g" /etc/network/interfaces sed -i "s/essid/$WIFI_ESSID/g" /etc/network/interfaces
# Add a password # Add a password
if [ ! $WIFI_PASSWORD ]; then if [ ! $WIFI_PASSWORD ]; then
TEMP_WIFI_PASSWORD=$(openssl rand -base64 8) TEMP_WIFI_PASSWORD=$(openssl rand -base64 8)
WIFI_PASSWORD=${$TEMP_WIFI_PASSWORD:0:8} WIFI_PASSWORD=${TEMP_WIFI_PASSWORD:0:8}
fi fi
# Add a password # Add a password