blob: 671b6fdeecdc676130cae259654d07882150f31b [file] [log] [blame]
developer3abe1ad2022-01-24 11:13:32 +08001#!/bin/ash
2# This script is used for wrapping atenl daemon to ated
3
4# 0 is normal mode, 1 is used for specific commands
5mode="0"
6add_quote="0"
7cmd="atenl"
developer461cb542022-04-29 18:17:44 +08008ori_inf=""
developer3abe1ad2022-01-24 11:13:32 +08009
10for i in "$@"
11do
12 if [ "$i" = "-c" ]; then
13 cmd="${cmd} -c"
14 mode="1"
15 add_quote="1"
16 elif [ "${add_quote}" = "1" ]; then
17 cmd="${cmd} \"${i}\""
18 add_quote="0"
19 else
developer93dadcc2022-07-13 10:25:35 +080020 if [ ${i} = "ra0" ] || [ ${i} = "rax0" ]; then
developer461cb542022-04-29 18:17:44 +080021 ori_inf=${i}
developer9b7cdad2022-03-10 14:24:55 +080022 i="phy0"
developer9b7cdad2022-03-10 14:24:55 +080023 fi
developer3abe1ad2022-01-24 11:13:32 +080024 cmd="${cmd} ${i}"
25 fi
26done
27
28if [ "$mode" = "0" ]; then
developer461cb542022-04-29 18:17:44 +080029 killall atenl > /dev/null 2>&1
developer3abe1ad2022-01-24 11:13:32 +080030fi
31
developer5698c9c2022-05-30 16:40:23 +080032eval "${cmd}"
developer461cb542022-04-29 18:17:44 +080033if [[ ! -z "${ori_inf}" ]]; then
34 echo "if_name: ${ori_inf}"
35fi