If your device is ezdiy rooted, you can create a
.sh startup script in:
/mnt/ext1/system/init.d
If not rooted you could add this to a launcher .app file for a frequently used app.
By default it creates a new global.cfg file as soon as the ask_connect_ts timestamp crosses 12 days.
Code:
#!/bin/sh
# Threshold to run - days x seconds_in_24hrs (needs to be less than 14 days)
daySecs=$((12*86400))
# current unix timestamp
utime=$(date +%s)
# current unix timestamp minus threshold
u2time=$(($utime-$daySecs))
# read ask_connect_ts timestamp from config file
eval $(grep "^ask_connect_ts=" /mnt/ext1/system/config/global.cfg)
# If timestamp is not yet 12 days old script exits
if [ $ask_connect_ts -gt $u2time ]; then
exit
fi
# sleep only needed if running as startup script
# allow startup process to finish with file before editing
sleep 15
# create new global.cfg file with new ask_connect_ts value
rm -f /mnt/ext1/system/config/global.cfg.back
mv /mnt/ext1/system/config/global.cfg /mnt/ext1/system/config/global.cfg.old
echo "" > /mnt/ext1/system/config/global.cfg
IFS=''; cat "/mnt/ext1/system/config/global.cfg.old" |
while read data; do
if echo "$data" | grep -q "ask_connect_ts"; then
echo "ask_connect_ts=$utime" >> "/mnt/ext1/system/config/global.cfg"
else echo "${data}" >> "/mnt/ext1/system/config/global.cfg"; fi
done
cp /mnt/ext1/system/config/global.cfg /mnt/ext1/system/config/global.cfg.back
rm -f /mnt/ext1/system/config/global.cfg.old
exit