#!/usr/bin/haserl
content-type: text/html
<%
path="$FORM_path"
ifro=""
if [ "$FORM_operation" == "showdir" ];then
ls -p "$path" | grep "/$" | sort
fi
IFRO(){
if [ "$path" == "/" ];then
ifro="ro"
else
partition="$(echo "$path" | cut -c2-11)"
ifro="$(mount | grep "$partition " | awk '{print $6}' | cut -c2-3)"
fi
}
if [ "$FORM_operation" == "newdir" ];then
IFRO
newdir="$FORM_newdir"
if [ "$ifro" == "rw" ];then
mkdir -m 777 "/rdisk0/disk1${path}${newdir}"
if [ "$?" == "1" ];then
echo "Error"
fi
else
echo "Error"
fi
fi
if [ "$FORM_operation" == "delete" ];then
IFRO
if [ "$ifro" == "rw" ];then
rm -rf "/rdisk0/disk1${path}"
else
echo "Error"
fi
fi
%>
阅读(8602) | 评论(0) | 转发(0) |