How to setup LTE connect automatically at system bootup

How to setup LTE connect automatically at system bootup?

My current approach is to set a script to be automatically executed at boot

in the /etc/init.d/startlegato.sh add a script to startup LTE connection

/etc/init.d/startlegato.sh

case "$1" in
    start)
        echo "Legato start sequence"

        umount /legato 2>/dev/null
        mount -o bind $LEGATO_MNT /legato
        nohup sh /home/root/user.sh >/dev/null 2>&1 &

the content of connection.sh as below:

#!/bin/bash

cm data apn internet
cm data auth none
cm data connect 

we can connect to internal via this script by manually, but it can’t work when it is automatically executed via startlegato.sh at bootup.
I don’t know why the cm command cannot be executed correctly.

you can build an unsandboxed legato application to call your script by system() API.
As this legato application will be run at boot up, so this script will also be run during boot up.

Please note that you need to use full path in your script or system() to call cm tool: