#!/bin/bash

if [ "$1" != "default" ]; then
    exit 1
fi

rm -fr /sbin/init /etc.default

# clean up the app
find /mnt/md[0-9]/User/ -name *.oexe | while read line
do
    rm -f "$line"
done

# clean up application
for app in `ls -1d /mnt/md[0-9]/application`
do
    rm -fr $app/*
done

# clean up @system
for sys in `ls -1d /mnt/md[0-9]/\@system`
do
    rm -fr $sys/*
done

exit 0
