developer | 3abe1ad | 2022-01-24 11:13:32 +0800 | [diff] [blame] | 1 | #!/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 |
| 5 | mode="0" |
| 6 | add_quote="0" |
| 7 | cmd="atenl" |
| 8 | |
| 9 | for i in "$@" |
| 10 | do |
| 11 | if [ "$i" = "-c" ]; then |
| 12 | cmd="${cmd} -c" |
| 13 | mode="1" |
| 14 | add_quote="1" |
| 15 | elif [ "${add_quote}" = "1" ]; then |
| 16 | cmd="${cmd} \"${i}\"" |
| 17 | add_quote="0" |
| 18 | else |
developer | 9b7cdad | 2022-03-10 14:24:55 +0800 | [diff] [blame] | 19 | if [ ${i} = "ra0" ]; then |
| 20 | i="phy0" |
| 21 | elif [ ${i} = "rax0" ]; then |
| 22 | i="phy1" |
| 23 | fi |
developer | 3abe1ad | 2022-01-24 11:13:32 +0800 | [diff] [blame] | 24 | cmd="${cmd} ${i}" |
| 25 | fi |
| 26 | done |
| 27 | |
| 28 | if [ "$mode" = "0" ]; then |
| 29 | killall atenl |
| 30 | fi |
| 31 | |
| 32 | eval "${cmd}" |