#!/bin/bash

# VERSION=1
# CHANGES=

## can not source VERSION.openssl file since it will update the PKG_NAME / PKG_PATH of the parent process
OPENSSL_VERSION=$(/bin/cat /usr/local/conf/rootfs/VERSION.openssl | /bin/grep OPENSSL_VERSION | /usr/bin/cut -d '=' -f 2)

## removing ugly reminiscence
/bin/rm -f /usr/lib/libcrypto.so.\*
/bin/rm -f /usr/lib/libssl.so.\*

if [[ -f /home/admin/lib/libcrypto.so.${OPENSSL_VERSION} ]] && [[ -f /home/admin/lib/libssl.so.${OPENSSL_VERSION} ]]; then
	/usr/fallback/beroconf delete root userapps-mustbe-reset
fi

## remount mtdblock5 and mtdblock7
/bin/mount -oremount,ro /
/bin/mount -oremount,ro /home/admin

exit 0
