#!/bin/sh
# Copyright (c) 2000-2016 Synology Inc. All rights reserved.

[ "$SYNOPKG_PKG_STATUS" = UPGRADE ] && exit 0

. "$(dirname $0)"/common

if [ -z "$pkgwizard_dataroot" ]; then
	log "$failed_illegal_dir_name" "$pkgwizard_dataroot"
	exit 1
fi

# check share create
dataPath="$SHARE_PATH/$pkgwizard_dataroot"
if ! mkdir -p "$dataPath"; then
	log "$failed_illegal_dir_name" "$pkgwizard_dataroot"
	exit 1
fi
chmod 755 "$dataPath"

exit 0
