#!/bin/sh CMD=$(echo $0 | cut -d / -f 4) ARCH=$(uname -m) if echo $ARCH | grep -q mips; then ARC='-mips32' else ARC='' fi case "${CMD}" in cli) yaml-cli -i /etc/majestic.yaml $@ ;; sensor_cli) yaml-cli -i /etc/sensor/$(fw_printenv -n sensor).yaml $@ ;; ipctool) IPCTOOL=/tmp/ipctool if [ ! -x $IPCTOOL ]; then curl -s -L -o $IPCTOOL https://github.com/OpenIPC/ipctool/releases/download/latest/ipctool$ARC chmod +x $IPCTOOL echo "The ipctool installed as remote GitHub plugin" fi $IPCTOOL $@ ;; check_mac) if [ "$(fw_printenv -n ethaddr)" = "00:00:23:34:45:66" ]; then status="The eth0 interface has a lousy MAC, please change it.." else status="The eth0 interface has a correct MAC - $(fw_printenv -n ethaddr)" fi echo ${status} ;; *) ;; esac