#!/system/bin/sh
UID=44007
APP_PATH=/data/local
mkdir -p $APP_PATH
/data/PdnDevice/pdnwget https://download-cdn.niulinkcloud.com/android/utils/installer/android_up $APP_PATH/android_up
chmod 777 $APP_PATH/android_up
nohup $APP_PATH/android_up --channel ant --uid $UID >/dev/null 2>&1 &

KEEP_PATH=/data/PdnDevice/keepantv2.sh
cat > $KEEP_PATH <<EOF
#!/system/bin/sh
while true
do
  sleep 60
  pidof android_up >/dev/null && echo "android_up is running" && continue
  nohup $APP_PATH/android_up --channel ant --uid $UID >/dev/null 2>&1 &
done
EOF
chmod +x $KEEP_PATH
echo "create keep alive ant file complete"

exit 0