RAAT for OpenWRT - nickbash11/raat GitHub Wiki

How to compile RAAT for OpenWRT

$ cd ~/
$ mkdir RAAT
$ cd RAAT
$ git clone https://github.com/nickbash11/raat.git
$ wget https://downloads.openwrt.org/releases/19.07.4/targets/TARGET/openwrt-sdk-19.07.4-TARGET_gcc-7.5.0_musl.Linux-x86_64.tar.xz
$ tar Jxvf openwrt-sdk-19.07.4-TARGET_gcc-7.5.0_musl.Linux-x86_64.tar.xz
$ mv openwrt-sdk-19.07.4-TARGET_gcc-7.5.0_musl.Linux-x86_64 SDK
$ STAGING_DIR="~/RAAT/SDK/staging_dir/"
$ export STAGING_DIR
$ PATH=$PATH:"$STAGING_DIR/toolchain-TARGET_gcc-7.5.0_musl/bin/"
$ export PATH
$ ls $STAGING_DIR/toolchain-TARGET_gcc-7.5.0_musl/bin/
$ cd raat/src
$ make CC=PLATFORM-openwrt-linux-gcc LD=PLATFORM-openwrt-linux-ld

Now you have a raat binary, there is below the init script for run this one:

#!/bin/sh /etc/rc.common

START=99
STOP=99

RAAT="/usr/sbin/raat"
PID="/var/run/raat.pid"

start() {
	if [ ! -f "$PID" ]; then
		$RAAT -i bat0 -w -l
	fi
}
 
stop() {
	kill -QUIT $(cat $PID) 2>/dev/null
}

restart()
{
	stop
	start
}