. /usr/syno/bin/jsoncmd
. /var/packages/DNSServer/scripts/backup/common

exportPath=$(jget "${SYNOPKG_BKP_INPUT}" ".temp_path")
if [ $? -ne 0 ];then
	jerr "bad parameters"
	exit 1
fi

bkfiles=$(getBackupFiles ${SYNOPKG_PKGPATH})

for dirAndFile in $bkfiles 
do
	dir=$(echo $dirAndFile |cut -d \; -f 1)
	file=$(echo $dirAndFile |cut -d \; -f 2)
	mkdir -p ${exportPath}/$dir
	cp -rf $file ${exportPath}/$dir/.
done

jout_begin
joutstr "app_data_version" "1.0"
jout_end

exit 0
