echo "Mini Config File ready,now,run ftpclient.sh from client!"
else
cp /etc/ftpaccess /etc/ftpaccess.bak
grep ^class /etc/ftpaccess.bak > /etc/ftpaccess
echo "Mini Config File ready,now,run ftpclient.sh from client!"
fi
elif [ $arg_count -eq 3 ] ; then
echo -e "class\t$arg_type\t$arg_type\t$arg_addr" > /etc/ftpaccess
echo "Only $arg_type user from $arg_addr be allowed to use the FTP Server"
else
echo -e $"\007Usage:\t$0 mini or $0 mini real/aonoymous address"
echo -e "\tUse \* or "*" or '*' to replace Any address"
fi
}
limit(){
class_defined
if [ $arg_count -ne 3 ] ; then
echo -e "\007Usage:\t\n$0 limit user_count times"
echo -e "\tuser_count --- MAX online users at the same time\n"
echo -e "\ttimes --- during the period of online users limited"
echo -e "\tMo --- Monday"
echo -e "\tTu --- Tuesday"
echo -e "\tWe --- Wednesday"
echo -e "\tTh --- Thursday"
echo -e "\tFr --- Friday"
echo -e "\tSa --- Saturday"
echo -e "\tSu --- Sunday"
echo -e "\tWk --- Weekend"
echo -e "\t0000-1800 --- from 00:00 to 18:00"
echo -e "\tMoTuWe --- Monday,Tuesday and Wednesday"
else
grep -v ^limit /etc/ftpaccess |grep -v ^$ > /etc/ftpaccess.tmp
mv -f /etc/ftpaccess.tmp /etc/ftpaccess
echo -e "limit\t$arg_class\t$arg_user_count\t$times\t/home/ftp/.too_many.$arg_class" >> /etc/ftpaccess
echo -e "\nMore than $arg_user_count ($arg_class class) users online." > /home/ftp/.too_many.$arg_class
echo -e "\nPlease try a later!" >> /home/ftp/.too_many.$arg_class
echo " Online $arg_class user limited to $arg_user_count at $times!"
fi
}
loginfails(){
class_defined
if [ `grep -c ^loginfails /etc/ftpaccess` -eq 1 ] ; then
grep -v ^loginfails /etc/ftpaccess > /etc/ftpaccess.tmp
mv -f /etc/ftpaccess.tmp /etc/ftpaccess
fi
if [ $arg_count -ne 2 ] ; then
echo -e "\007Usage:\t$0 loginfails failed_counts"
else
echo -e "loginfails\t$failed_count" >> /etc/ftpaccess
echo "loginfails count limited to $failed_count !"
fi
}
view(){
echo -e "\n* * * * * /etc/ftpaccess * * * * *\n "
cat /etc/ftpaccess
echo -e "\n* * * * * /etc/ftpusers * * * * *\n "
cat /etc/ftpusers
echo -e "\n* * * * * /etc/ftphosts * * * * *\n "
cat /etc/ftphosts
# echo -e "\n****/etc/ftpgroups****\n "
# cat /etc/ftpgroups
# echo -e "\n****/etc/ftpconversions****\n "
# cat /etc/ftpconversions
}
access(){
class_defined
if [ `grep -c ^guestgroup /etc/ftpaccess` -lt 1 ] ; then
echo -e "\007\nGuestgroup define not found! please run $0 guest username first !"
exit 1
fi
if [ `grep -c ^upload /etc/ftpaccess` -ne 0 ] ; then
grep -v ^upload /etc/ftpaccess > /etc/ftpaccess.tmp
mv -f /etc/ftpaccess.tmp /etc/ftpaccess
fi
if [ -d /home/ftp/upload ] ;then
echo "Directory /home/ftp/upload exist !"
else
mkdir /home/ftp/upload
chmod a w /home/ftp/upload
echo "Directory /home/ftp/upload for user to upload files redeay !"
fi
echo -e "\nupload\t/home/ftp/*\t/\tno" >> /etc/ftpaccess
echo -e "upload\t/home/ftp/*\t/etc\tno" >> /etc/ftpaccess
echo -e "upload\t/home/ftp/*\t/dev\tno"\n >> /etc/ftpaccess
echo -e "\nupload\t/home/ftp\t/upload\tyes\troot\tftpadmin\t0600\tnodirs\n" >> /etc/ftpaccess
echo "You can upload files only to directory /upload !"
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




