#!/bin/sh

# Script to process an uploaded geop20 default GEOP file on the Cion
cd /tmp/uploads

# md5 check
md5sum --check --status geop20.md5

if [[ "$?" -eq "1" ]]; then
echo md5sum verification failed on geop20.md5 at `time` > /tmp/logs/geop20.log
mount -o remount,sync /
sync
mount -o remount,async /
exit 1
fi

rm -f /tmp/uploads/geop20.md5

cd -
mount -o remount,sync /

# Process the uploaded file. No reinit
mv -f /tmp/uploads/geop20 /usr/local/instrument/recvNav/config/goa-var/time-pole/iersa/geop20
# echo r > /var/volatile/RtgxOrbiter/RTGX/rtgx_controlPipe

# Cleanup
sync
mount -o remount,async /
exit 0
