| 1 | #!/system/bin/sh |
| 2 | |
| 3 | load_wifi() |
| 4 | { |
| 5 | echo "load_wifi" |
| 6 | |
| 7 | # this just prevents Android wifi loader from craping out, |
| 8 | # (it only functions properly if starting from "ok" state) |
| 9 | setprop wlan.driver.status ok |
| 10 | |
| 11 | return 0; |
| 12 | } |
| 13 | |
| 14 | unload_wifi() |
| 15 | { |
| 16 | echo "unload_wifi" |
| 17 | return 0; |
| 18 | } |
| 19 | |
| 20 | # |
| 21 | # Deal with the type of invocation we get. |
| 22 | # |
| 23 | case "$1" in |
| 24 | "start") |
| 25 | load_wifi |
| 26 | ;; |
| 27 | stop) |
| 28 | if ! unload_wifi; then |
| 29 | echo "Couldn't unload wifi modules" >&2; |
| 30 | fi |
| 31 | ;; |
| 32 | reload|restart) |
| 33 | if unload_wifi; then |
| 34 | load_wifi |
| 35 | else |
| 36 | echo "Couldn't unload wifi modules" >&2; |
| 37 | fi |
| 38 | ;; |
| 39 | *) |
| 40 | echo "$0: unknown argument $1." >&2; |
| 41 | ;; |
| 42 | esac |
| 43 | |