diff --git a/data/etc/scripts/01-network b/bootstrap/S01-network.sh
old mode 100755
new mode 100644
similarity index 95%
rename from data/etc/scripts/01-network
rename to bootstrap/S01-network.sh
index ad5c942..f12f4b8
--- a/data/etc/scripts/01-network
+++ b/bootstrap/S01-network.sh
@@ -1,7 +1,6 @@
#!/bin/sh
source /etc/fang_hacks.cfg
-source /media/mmcblk0p2/data/etc/profile
NETWORK_MODE=${NETWORK_MODE:-0}
DISABLE_CLOUD=${DISABLE_CLOUD:-0}
@@ -55,7 +54,7 @@ start()
kill_network
wpa_supplicant -B -i wlan0 \
- -c /media/mmcblk0p2/data/etc/wpa_supplicant.conf \
+ -c ${CFG_WPA} \
-P /var/run/wpa_supplicant.pid 2>&1
rc=$?
if [ $rc -eq 0 ]; then
@@ -82,11 +81,11 @@ start()
if [ $? -ne 0 ]; then
echo "Failed to set IP $ap_addr"; return 1;
fi
- hostapd -B -P /var/run/hostapd.pid /media/mmcblk0p2/data/etc/hostapd.conf 2>&1
+ hostapd -B -P /var/run/hostapd.pid ${CFG_AP} 2>&1
if [ $? -ne 0 ]; then
echo "Failed to start hostapd"; return 1;
fi
- udhcpd -f /media//mmcblk0p2/data/etc/udhcpd.conf >>/tmp/hacks.log 2>&1 &
+ udhcpd -f ${CFG_DHCPD} >>/tmp/hacks.log 2>&1 &
if [ $? -ne 0 ]; then
echo "Failed to start udhcpd"; return 1;
fi
@@ -191,4 +190,4 @@ else
$1 "$@"
;;
esac
-fi
+fi
\ No newline at end of file
diff --git a/bootstrap/S02-mount.sh b/bootstrap/S02-mount.sh
new file mode 100644
index 0000000..86266c2
--- /dev/null
+++ b/bootstrap/S02-mount.sh
@@ -0,0 +1,19 @@
+source /etc/fang_hacks.cfg
+
+start()
+{
+ for p in $MOUNTS;do
+ mkdir -p $p
+ done
+ mount -a
+}
+
+status()
+{
+ mount
+}
+
+case $1 in start|status)
+ $1 "$@"
+ ;;
+esac
diff --git a/bootstrap/fang_hacks.sh b/bootstrap/fang_hacks.sh
index eaec91a..847fe89 100755
--- a/bootstrap/fang_hacks.sh
+++ b/bootstrap/fang_hacks.sh
@@ -93,6 +93,7 @@ if [ "$DISABLE_CLOUD" -eq 0 ]; then
logmsg "Starting boa webserver..."
# Copy to /tmp as a workaround for weird boa error (can't open boa.conf)
cp /usr/boa/* /tmp
+ mkdir -p /tmp/cgi-bin
/tmp/boa >/dev/null 2>&1
fi
@@ -105,11 +106,16 @@ else
logmsg "Starting boa webserver..."
# Copy to /tmp as a workaround for weird boa error (can't open boa.conf)
cp /usr/boa/* /tmp
+ mkdir -p /tmp/www/cgi-bin
/tmp/boa >/dev/null 2>&1
fi
# Link cgi files again if available (/tmp is volatile)
-CGI_FILES="/media/mmcblk0p1/bootstrap/www"
+if [ -d "${HACKS_HOME}/www" ]; then
+ CGI_FILES="${HACKS_HOME}/www"
+else
+ CGI_FILES=/media/mmcblk0p1/bootstrap/www
+fi
if [ -d "$CGI_FILES" ]; then
for i in $CGI_FILES/*; do
if [ ! -e "/tmp/www/cgi-bin/$(basename $i)" ]; then
diff --git a/bootstrap/www/action b/bootstrap/www/action
index de76c76..ff85d82 100755
--- a/bootstrap/www/action
+++ b/bootstrap/www/action
@@ -86,6 +86,8 @@ apply()
apply_file "/media/mmcblk0p1/bootstrap/rcS" "/etc/init.d/rcS" 755
apply_file "/media/mmcblk0p1/bootstrap/fang_hacks.sh" "/etc/fang_hacks.sh" 755
apply_file "/media/mmcblk0p1/bootstrap/fang_hacks.cfg" "/etc/fang_hacks.cfg" 644
+ apply_file "/media/mmcblk0p1/bootstrap/S01-network.sh" "/etc/init.d/S01-network.sh" 755
+ apply_file "/media/mmcblk0p1/bootstrap/S02-mount.sh" "/etc/init.d/S02-mount.sh" 755
if [ -x "/etc/fang_hacks.sh" ]; then
echo "Running fang_hacks.sh...
"
diff --git a/bootstrap/www/scripts b/bootstrap/www/scripts
index c676c35..33369aa 100755
--- a/bootstrap/www/scripts
+++ b/bootstrap/www/scripts
@@ -28,8 +28,10 @@ button, input[type=submit] { background-color: #ddeaff; }
$($SCRIPT_HOME/$script 2>&1)" - ;; + ;; disable) echo "Disable script '$script'...