#!/bin/sh #Set alarm profile
uci set profiles.general.profile=alarm
uci commit profiles
/etc/init.d/profiler restart #Restart I/O juggler
/etc/init.d/iojuggler restart #Send active profile in response SMS
echo -n "Profile is => " && uci show profiles.general.profile | cut -c 26-40
1/ To get a distinct function working I had to add the juggler restart. Why ? Is there anything else you have to consider using scripts ?
2/ Swapping profile via the GUI makes the WiFi restart but when using a SMS script it stays up the whole time. How come ?
When a profile switch is triggered via the WebUI, any relevant services, including WiFi, are automatically restarted for the changes to take effect. This is why the WiFi restarts when you switch the profile via WebUI. However, when initiating a profile switch via a script, these service restarts are not automatically handled. In such cases, you need to manually restart the relevant services to ensure the changes take effect. This is why you need to restart the I/O Juggler service when switching profiles via your script, as it’s responsible for handling I/O operations.
OK, so for example if I swap between 2 profiles with a script, one with active WiFi and the other with no WiFi, I also have to restart the WiFi service to make it happened ?
Correct. When you change the profile via a script, you change the configurations. You should then restart the relevant services for the services to apply the new configurations.