blob: 671b6fdeecdc676130cae259654d07882150f31b [file] [log] [blame]
#!/bin/ash
# This script is used for wrapping atenl daemon to ated
# 0 is normal mode, 1 is used for specific commands
mode="0"
add_quote="0"
cmd="atenl"
ori_inf=""
for i in "$@"
do
if [ "$i" = "-c" ]; then
cmd="${cmd} -c"
mode="1"
add_quote="1"
elif [ "${add_quote}" = "1" ]; then
cmd="${cmd} \"${i}\""
add_quote="0"
else
if [ ${i} = "ra0" ] || [ ${i} = "rax0" ]; then
ori_inf=${i}
i="phy0"
fi
cmd="${cmd} ${i}"
fi
done
if [ "$mode" = "0" ]; then
killall atenl > /dev/null 2>&1
fi
eval "${cmd}"
if [[ ! -z "${ori_inf}" ]]; then
echo "if_name: ${ori_inf}"
fi