#!/bin/sh
# Copyright (C) 2012 GuoWenxue <guowenxue@gmail.com QQ:281143292>

zone=$1

if (test "apps" = "$zone")
then
        if !(mount -w -o remount,sync,noatime /apps)
        then
                echo "Failed to unlock zone $zone"
                exit 1
        fi
elif (test "info" = "$zone")
then
        if !(mount -w -o remount,sync,noatime /info)
        then
                echo "Failed to unlock zone $zone"
                exit 1
        fi
elif (test "data" = "$zone")
then
        if !(mount -w -o remount,sync,noatime /data)
        then
                echo "Failed to unlock zone $zone"
                exit 1
        fi
elif (test -z "$zone")
then
        echo "Usage: unlock zone"
        echo "       zone: apps | info | data"
        exit 1
else
        echo "Zone $zone is not supported"
        exit 1
fi
 
exit 0
