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 | ||||
19 | cmd="${cmd} ${i}" | ||||
20 | fi | ||||
21 | done | ||||
22 | |||||
23 | if [ "$mode" = "0" ]; then | ||||
24 | killall atenl | ||||
25 | fi | ||||
26 | |||||
27 | eval "${cmd}" |