#!/bin/bash echo "-- add kaid ..." DLD_DIR="${HOMEDIR}/dl" KAID_DIR="${HOMEDIR}/addon/tmp/kaid" [ -d "$DLD_DIR" ] || mkdir "$DLD_DIR" #[ -d "$KAID_DIR" ] || mkdir "$KAID_DIR" DLD_TPL="http://www.teamxlink.co.uk/binary/kaid-7.0.0.7-mips.tar.gz" IMG_REQ="${DLD_TPL##*/}" KAID_DIR1="${IMG_REQ%.tar.gz*}" if ! [ -f "$KAID_DIR/$KAID_DIR1/kaid" ]; then [ -f "$DLD_DIR/$IMG_REQ" ] || wget -P "$DLD_DIR" "$DLD_TPL" 2>&1 echo " -- unpacking Xlink kai engine ..." tar -xif "$DLD_DIR/$IMG_REQ" -C "$KAID_DIR" fi if ! [ -f "$KAID_DIR/$KAID_DIR1/kaid" ]; then echo "-- you must download the $DLD_TPL to $DLD_DIR first!" exit 1 fi cp -f "$KAID_DIR/$KAID_DIR1/kaid" --target-directory="${SRC}/usr/bin" cp -f "$KAID_DIR/kaid.conf" --target-directory="${SRC}/etc" chmod +x "${SRC}/usr/bin/kaid" [ ! -L "${SRC}/tmp" ] && ln -s /var/tmp "${SRC}/tmp" echo "touch /tmp/kaiSystemConfig.txt" >> "${SRC}"/etc/init.d/rc.S echo "touch /tmp/kaiEnginePersist.txt" >> "${SRC}"/etc/init.d/rc.S sed -i -e "/exit 0/d" "${SRC}"/etc/init.d/rc.S #start telnet echo "/usr/sbin/telnetd -l /sbin/ar7login" >> "${SRC}"/etc/init.d/rc.S echo "sleep 40" >> "${SRC}"/etc/init.d/rc.S echo "kaid -d" >> "${SRC}"/etc/init.d/rc.S echo 'echo "kaid started in the backgrund"' >> "${SRC}"/etc/init.d/rc.S #echo "/usr/bin/kaid -c /etc/kaid.conf > /var/tmp/kaid.log" >> "${SRC}"/etc/init.d/rc.S exit 0