Index: /branches/sslvpn_IOT/motionpro_pc/build/linux/install-yocto.sh
===================================================================
--- /branches/sslvpn_IOT/motionpro_pc/build/linux/install-yocto.sh	(revision 8447)
+++ /branches/sslvpn_IOT/motionpro_pc/build/linux/install-yocto.sh	(working copy)
@@ -21,6 +21,7 @@
 generate_id=clientid_linux64
 vpnservice=mpsslvpn.service
 vpnconf=mpsslvpn.conf
+vpncheck=check_vpn.sh
 # help=help
 # qm=*.qm
 # start_script=
@@ -97,6 +98,7 @@
     /bin/cp -p ./$hwidclient $prefix    
     # /bin/cp -p ./$start_script $systemd_dir
     /bin/cp -p ./$vpnconf $prefix
+    /bin/cp -p ./$vpncheck $prefix
 
     # # create desktop shortcut
     # echo "creating desktop shortcut for MotionPro..."
@@ -150,6 +152,10 @@
     # Enable vpnd and ssl connection when boot
     # /bin/systemctl enable $vpnservice
 
+    # Add check_vpn script to crontab
+    cron_entry="* * * * * root /opt/MotionPro/check_vpn.sh"
+    echo "$cron_entry" | sudo tee -a /etc/crontab
+
     # Execute MotionPro script to init
     $prg_link start
     exit 0
@@ -208,6 +214,10 @@
         /bin/rm -rf $hardware
     fi
     
+    #delete check_vpn from crontab
+    cron_entry="* * * * * root /opt/MotionPro/check_vpn.sh"
+    sudo sed -i "\|$cron_entry|d" /etc/crontab
+
     # Disable vpnd and ssl connection when boot
     # systemctl disable mpsslvpn.service
 
