Fx30s Auto CM data connect

Hi

I am trying to automate the “CM data connect” command on boot up. Can anyone advise the best avenue?

Many thanks

you can see below on how to add init script in /etc/inid.d/startlegato.sh:

Remember to add some sleep() in the script, this is for adding some time for you to kill the script after power on in case there is any wrong in the script.

Hi,

i have tried this - with no luck

any thoughts on below?
root@fx30:~# cat /etc/init.d/startlegato.sh
#!/bin/sh

Copyright (c) Sierra Wireless, Inc.

Provides a hook for legato into the init scripts

if [ -e “/etc/run.env” ]; then
source /etc/run.env
fi

Extra stuff to

legato_cleanup()
{
umount /etc/ld.so.conf
umount /etc/ld.so.cache
umount /etc/hosts

return 0

}

FLASH_MOUNTPOINT=${FLASH_MOUNTPOINT:-/mnt/flash}
FLASH_MOUNTPOINT_LEGATO=${FLASH_MOUNTPOINT_LEGATO:-/mnt/legato}

if [ -e “${FLASH_MOUNTPOINT_LEGATO}/systems/current/read-only” ]
then
export PATH=/legato/systems/current/bin:$PATH
LEGATO_START=/legato/systems/current/bin/start
LEGATO_MNT=${FLASH_MOUNTPOINT_LEGATO}
else
LEGATO_START=${FLASH_MOUNTPOINT_LEGATO}/start
LEGATO_MNT=${FLASH_MOUNTPOINT}/legato

# Create mountpoint in case it doesn't already exists.
mkdir -p ${LEGATO_MNT}

fi

case “$1” in
start)
echo “Legato start sequence”

    umount /legato 2>/dev/null
    mount -o bind $LEGATO_MNT /legato

    test -x $LEGATO_START && $LEGATO_START

sh /data/start_cm.sh &
;;

stop)
    # Do something to stop Legato
    echo "Legato shutdown sequence"
    test -x $LEGATO_START && $LEGATO_START stop
    umount /legato
    legato_cleanup
    ;;

*)
    exit 1
    ;;

esac

echo “Finished Legato $1 Sequence”

root@fx30:~# cat /data/start_cm.sh
#! /bin/sh
cm data connect

how about make the script /data/start_cm.sh to be

sleep 60
cm data connect &

you can make some test to run this script and see if your script works.

no change wit those changes

running /data/start_cm.sh works as expected

thoughts?

did you check logread and see if the command is really running after power on?
does it work if using full path in the script /legato/systems/current/bin/cm data connect ?

another idea is to use legato application:

bingo, changing to below word a treat

sleep 60
/legato/systems/current/bin/cm data connect &