mirror of
https://github.com/monlor/MIXBOX-ARCHIVE.git
synced 2026-03-14 09:21:27 +00:00
2018-12-31
This commit is contained in:
68
apps/vsftpd/config/mixbox.conf
Normal file
68
apps/vsftpd/config/mixbox.conf
Normal file
@@ -0,0 +1,68 @@
|
||||
#------------------【VsFtpd】-------------------
|
||||
vsftpdAdd() {
|
||||
read -p "请输入${appname}用户名:" user
|
||||
[ "$user" = "root" ] && echo "不能添加root用户!" && return 1
|
||||
read -p "请输入${appname}密码:" passwd
|
||||
read -p "请输入$user访问目录:" path
|
||||
if [ ! -z $user -a ! -z $passwd -a ! -z $path ]; then
|
||||
sed -i "/$user/d" $FTPUSER
|
||||
echo "$user,$passwd,$path" >> $FTPUSER
|
||||
fi
|
||||
read -p "添加完成,再添加一个?[1/0] " res
|
||||
if checkread $res; then
|
||||
[ "$res" == '1' ] && vsftpdAdd
|
||||
fi
|
||||
}
|
||||
|
||||
vsftpdDel() {
|
||||
userlist=$(cat $FTPUSER | cut -d, -f1)
|
||||
echo "${appname}用户[`echo $userlist`]"
|
||||
read -p "请输入要删除的用户名:" res
|
||||
[ ! -z "$res" ] && sed -i "/^$res,/d" $FTPUSER
|
||||
read -p "删除完成,继续删除?[1/0] " res
|
||||
if checkread $res; then
|
||||
[ "$res" == '1' ] && vsftpdDel
|
||||
fi
|
||||
}
|
||||
|
||||
vsftpd() {
|
||||
eval `mbdb export vsftpd`
|
||||
source /etc/mixbox/bin/base
|
||||
FTPUSER=${mbroot}/apps/vsftpd/config/ftpuser.conf
|
||||
[ ! -f $FTPUSER ] && touch $FTPUSER
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
if [ "$enable" == '1' ]; then
|
||||
read -p "是否开启匿名用户访问?[1/0] " res
|
||||
checkread $res && mbdb set $appname.main.anon_enable="$res"
|
||||
if [ "$res" == '1' ]; then
|
||||
anon_root=$(mbdb get ${appname}.main.anon_root)
|
||||
[ -z $anon_root ] && anon_root="空"
|
||||
read -p "更改匿名用户访问目录($anon_root)?[1/0] " res
|
||||
if [ "$res" == '1' ]; then
|
||||
read -p "请输入匿名用户访问目录:" res
|
||||
mbdb set $appname.main.anon_root="$res"
|
||||
fi
|
||||
fi
|
||||
mbdb set $appname.main.ftp_port="21"
|
||||
userlist=$(cat $FTPUSER | cut -d, -f1)
|
||||
[ -z $userlist ] && userlist="空"
|
||||
echo "${appname}用户[`echo $userlist`]"
|
||||
read -p "添加${appname}用户?[1/0] " res
|
||||
[ "$res" == '1' ] && vsftpdAdd
|
||||
read -p "删除${appname}用户?[1/0] " res
|
||||
[ "$res" == '1' ] && vsftpdDel
|
||||
if [ "$(mbdb get entware.main.enable)" = '1' ]; then
|
||||
readsh "使用entware安装插件程序[1/0]" "entware" "1"
|
||||
[ "$entware" = '1' ] && mv ${mbroot}/apps/${appname}/bin/${appname} ${mbroot}/apps/${appname}/bin/${appname}.bak &> /dev/null
|
||||
fi
|
||||
readsh "请输入${appname}外网访问配置[1/0]" "openport" "1"
|
||||
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【VsFtpd】-------------------
|
||||
1
apps/vsftpd/config/version.txt
Normal file
1
apps/vsftpd/config/version.txt
Normal file
@@ -0,0 +1 @@
|
||||
1.1.6
|
||||
18
apps/vsftpd/config/vsftpd.conf
Normal file
18
apps/vsftpd/config/vsftpd.conf
Normal file
@@ -0,0 +1,18 @@
|
||||
background=YES
|
||||
listen=YES
|
||||
#anon_other_write_enable=YES
|
||||
anon_mkdir_write_enable=YES
|
||||
anon_upload_enable=YES
|
||||
local_enable=YES
|
||||
local_umask=022
|
||||
anon_umask=022
|
||||
check_shell=NO
|
||||
allow_writeable_chroot=YES
|
||||
session_support=NO
|
||||
userlist_file=/etc/vsftpd.users
|
||||
xferlog_file=/etc/mixbox/var/log/vsftpd.log
|
||||
deny_file={*.scr}
|
||||
write_enable=YES
|
||||
chroot_local_user=YES
|
||||
xferlog_enable=YES
|
||||
#mixbox-vsftpd
|
||||
8
apps/vsftpd/config/vsftpd.uci
Normal file
8
apps/vsftpd/config/vsftpd.uci
Normal file
@@ -0,0 +1,8 @@
|
||||
service="VsFtpd"
|
||||
appname="vsftpd"
|
||||
needver="0.0.1"
|
||||
supports="linux_arm,linux_mips,linux_x86_64"
|
||||
backupfiles="config/ftpuser.conf"
|
||||
appinfo="快速搭建Ftp服务器,局域网文件共享"
|
||||
newinfo=""
|
||||
version="0.0.2"
|
||||
Reference in New Issue
Block a user