commit d32bfde228a777c7f89d7c9ceecdbbd616f81bef
Author: p4u <hakais@gmail.com>
Date:   Fri Sep 28 16:08:08 2012 +0200

    Script to modify Ubiquiti target image and be able to use the AirOS web interface to upload the firmware

diff --git a/scripts/ubnt-fix-image.script b/scripts/ubnt-fix-image.script
new file mode 100755
index 0000000..b74b4bd
--- /dev/null
+++ b/scripts/ubnt-fix-image.script
@@ -0,0 +1,17 @@
+#!/bin/bash
+# This scripts changes the header string which is 
+# read by the AirOs web interface to determine if 
+# the firmware is valid or not.
+
+UBNT_TARGETS="nsm5 rocket nsm2 bullet"
+
+[ "$1" != "PRE_BUILD" ] && exit 0
+
+shift
+TARGET="$1"
+
+[ -z "$TARGET" ] || [ ! -d "build/nsm5" ] && exit 1
+[[ "$UBNT_TARGETS" =~ "$TARGET" ]] || exit 2
+
+FILE="build/nsm5/target/linux/ar71xx/image/Makefile"
+sed -i -e s/"XM,ar7240)"/"XM,ar7240.v5.3.6)"/g $FILE
