echo Stop robot processes...
systemctl stop anki-robot.target
echo Sleep for 5 seconds to ensure everything is stopped
sleep 5s
echo Mounting / as rw...
mount -o rw,remount /
echo Removing old server config...
rm /anki/data/assets/cozmo_resources/config/server_config.json
echo Fetch and install Viccyware server config...
curl -o /anki/data/assets/cozmo_resources/config/server_config.json http://api.froggitti.net/server_config.json
echo Install new vic-cloud in case you are using wire-pod
rm /anki/bin/vic-cloud
curl -o /anki/bin/vic-cloud http://api.froggitti.net/vic-cloud
chmod +x /anki/bin/vic-cloud
echo Remove onboarding data and old server token...
rm /data/data/com.anki.victor/persistent/token/token.jwt /data/data/com.anki.victor/persistent/onboarding/*
echo Your Vector is ready to use the Viccyware servers. To set him up with them, go to https://v.vicw.xyz. Rebooting in 5 seconds...
sleep 5s
reboot
