I want to call a script from my init.rc
:
service script /system/etc/wifi.sh
user system
group wifi
class main
oneshot
Content of wifi.sh
:
#!/system/bin/sh
service p2p_supplicant /system/bin/wpa_supplicant \
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf
class late_start
disabled
oneshot
But p2p_supplicant
service is not started.
Is it possible to call service from another service?
You could have your bash script wait for the desired process to start running before it does anything. See this article for information: Bash wait for process start
In your specific case it seems like there is a better way to configure the supplicant using parameters and the conf file that doesn't involve running a shell script.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.