first commit
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
/*.pkg.tar.zst
|
||||||
|
/src/
|
||||||
|
/pkg/
|
||||||
40
PKGBUILD
Normal file
40
PKGBUILD
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# Maintainer: zj <1052308357@qq.com>
|
||||||
|
|
||||||
|
pkgname=tms-vsftpd-config
|
||||||
|
pkgver=12
|
||||||
|
pkgrel=27
|
||||||
|
pkgdesc="vsftpd tms conifg."
|
||||||
|
arch=('x86_64')
|
||||||
|
url="https://yuyujing.cn"
|
||||||
|
license=('Proprietary')
|
||||||
|
|
||||||
|
depends=('vsftpd')
|
||||||
|
|
||||||
|
source=("${pkgname}.tar.gz")
|
||||||
|
|
||||||
|
sha256sums=('e2feb09b718838aed42d25228f033b50629d5e45870841955b19962cd88a56e5')
|
||||||
|
|
||||||
|
install="${pkgname}.install"
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
cd "${srcdir}/${pkgname}"
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
msg "No build step required for this package."
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
|
||||||
|
local _config="/etc"
|
||||||
|
local _config_base_dir="/etc/pam.d"
|
||||||
|
|
||||||
|
install -d -m755 "${pkgdir}${_config}"
|
||||||
|
install -d -m755 "${pkgdir}${_config_base_dir}"
|
||||||
|
|
||||||
|
cd "${srcdir}/${pkgname}"
|
||||||
|
|
||||||
|
install -m644 vsftpd "${pkgdir}${_config_base_dir}/vsftpd.tms"
|
||||||
|
install -m644 vsftpd.conf "${pkgdir}${_config}/vsftpd.conf.tms"
|
||||||
|
|
||||||
|
}
|
||||||
50
tms-vsftpd-config.install
Normal file
50
tms-vsftpd-config.install
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# pre_install 钩子在安装文件复制到系统之前运行
|
||||||
|
pre_install() {
|
||||||
|
echo "stop ftp service"
|
||||||
|
systemctl stop vsftpd.service
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# post_install: 在软件包安装后执行
|
||||||
|
post_install() {
|
||||||
|
|
||||||
|
echo "user add tms and kdm"
|
||||||
|
|
||||||
|
useradd tms
|
||||||
|
usermod -m -d /media/cinema tms
|
||||||
|
usermod -m -d /media/cinema tms
|
||||||
|
useradd kdm
|
||||||
|
usermod -m -d /media/kdm kdm
|
||||||
|
usermod -m -d /media/kdm kdm
|
||||||
|
|
||||||
|
|
||||||
|
echo "Checking vsftpd config and bakup"
|
||||||
|
|
||||||
|
[ -f /etc/vsftpd.conf ] && mv /etc/vsftpd.conf /etc/vsftpd.conf.bakup
|
||||||
|
[ -f /etc/pam.d/vsftpd ] && mv /etc/pam.d/vsftpd /etc/pam.d/vsftpd.bakup
|
||||||
|
|
||||||
|
|
||||||
|
mv /etc/vsftpd.conf.tms /etc/vsftpd.conf
|
||||||
|
mv /etc/pam.d/vsftpd.tms /etc/pam.d/vsftpd
|
||||||
|
|
||||||
|
|
||||||
|
echo "start vsftpd.service"
|
||||||
|
|
||||||
|
systemctl start vsftpd.service
|
||||||
|
systemctl enable vsftpd.service
|
||||||
|
}
|
||||||
|
|
||||||
|
# pre_remove: 在软件包卸载前执行
|
||||||
|
pre_remove() {
|
||||||
|
echo "Stopping and disabling pure-ftpd.service..."
|
||||||
|
systemctl stop vsftpd.service
|
||||||
|
systemctl disable vsftpd.service
|
||||||
|
}
|
||||||
|
|
||||||
|
# post_remove: 在软件包卸载后执行
|
||||||
|
post_remove() {
|
||||||
|
echo "Reloading systemd configuration after removal..."
|
||||||
|
[ -f /etc/vsftpd.conf.bakup ] && mv /etc/vsftpd.conf.bakup /etc/vsftpd.conf
|
||||||
|
[ -f /etc/pam.d/vsftpd.bakup ] && mv /etc/pam.d/vsftpd.bakup /etc/pam.d/vsftpd
|
||||||
|
|
||||||
|
}
|
||||||
BIN
tms-vsftpd-config.tar.gz
Normal file
BIN
tms-vsftpd-config.tar.gz
Normal file
Binary file not shown.
6
tms-vsftpd-config/vsftpd
Normal file
6
tms-vsftpd-config/vsftpd
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#%PAM-1.0
|
||||||
|
auth required /lib/security/pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
|
||||||
|
auth required /lib/security/pam_unix.so shadow nullok
|
||||||
|
auth required /lib/security/pam_nologin.so
|
||||||
|
account required /lib/security/pam_unix.so
|
||||||
|
session required /lib/security/pam_unix.so
|
||||||
21
tms-vsftpd-config/vsftpd.conf
Normal file
21
tms-vsftpd-config/vsftpd.conf
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# 基本设置
|
||||||
|
listen=YES
|
||||||
|
anonymous_enable=NO
|
||||||
|
local_enable=YES
|
||||||
|
write_enable=YES
|
||||||
|
local_umask=022
|
||||||
|
|
||||||
|
chroot_local_user=YES
|
||||||
|
allow_writeable_chroot=YES
|
||||||
|
|
||||||
|
pasv_enable=YES
|
||||||
|
pasv_min_port=40000
|
||||||
|
pasv_max_port=50000
|
||||||
|
|
||||||
|
ssl_enable=NO
|
||||||
|
|
||||||
|
xferlog_enable=YES
|
||||||
|
xferlog_file=/var/log/vsftpd.log
|
||||||
|
xferlog_std_format=YES
|
||||||
|
|
||||||
|
pam_service_name=vsftpd
|
||||||
68
up+.sh
Executable file
68
up+.sh
Executable file
@@ -0,0 +1,68 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#set -e
|
||||||
|
##################################################################################################################
|
||||||
|
# Author : Erik Dubois
|
||||||
|
# Website : https://www.erikdubois.be
|
||||||
|
# Website : https://www.alci.online
|
||||||
|
# Website : https://www.ariser.eu
|
||||||
|
# Website : https://www.arcolinux.info
|
||||||
|
# Website : https://www.arcolinux.com
|
||||||
|
# Website : https://www.arcolinuxd.com
|
||||||
|
# Website : https://www.arcolinuxb.com
|
||||||
|
# Website : https://www.arcolinuxiso.com
|
||||||
|
# Website : https://www.arcolinuxforum.com
|
||||||
|
##################################################################################################################
|
||||||
|
#
|
||||||
|
# DO NOT JUST RUN THIS. EXAMINE AND JUDGE. RUN AT YOUR OWN RISK.
|
||||||
|
#
|
||||||
|
##################################################################################################################
|
||||||
|
#tput setaf 0 = black
|
||||||
|
#tput setaf 1 = red
|
||||||
|
#tput setaf 2 = green
|
||||||
|
#tput setaf 3 = yellow
|
||||||
|
#tput setaf 4 = dark blue
|
||||||
|
#tput setaf 5 = purple
|
||||||
|
#tput setaf 6 = cyan
|
||||||
|
#tput setaf 7 = gray
|
||||||
|
#tput setaf 8 = light blue
|
||||||
|
##################################################################################################################
|
||||||
|
|
||||||
|
# reset - commit your changes or stash them before you merge
|
||||||
|
# git reset --hard - personal alias - grh
|
||||||
|
|
||||||
|
echo "Deleting the work folder if one exists"
|
||||||
|
[ -d work ] && rm -rf work
|
||||||
|
|
||||||
|
# checking if I have the latest files from github
|
||||||
|
echo "Checking for newer files online first"
|
||||||
|
git pull
|
||||||
|
|
||||||
|
# Below command will backup everything inside the project folder
|
||||||
|
git add --all .
|
||||||
|
|
||||||
|
# Give a comment to the commit if you want
|
||||||
|
echo "####################################"
|
||||||
|
echo "Write your commit comment!"
|
||||||
|
echo "####################################"
|
||||||
|
|
||||||
|
read input
|
||||||
|
|
||||||
|
# Committing to the local repository with a message containing the time details and commit text
|
||||||
|
|
||||||
|
git commit -m "$input"
|
||||||
|
|
||||||
|
# Push the local files to github
|
||||||
|
|
||||||
|
if grep -q main .git/config; then
|
||||||
|
echo "Using main"
|
||||||
|
git push -u origin main
|
||||||
|
fi
|
||||||
|
|
||||||
|
if grep -q master .git/config; then
|
||||||
|
echo "Using master"
|
||||||
|
git push -u origin master
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "################################################################"
|
||||||
|
echo "################### Git Push Done ######################"
|
||||||
|
echo "################################################################"
|
||||||
Reference in New Issue
Block a user