Browse Source

fix ftp_add

master
VirtuBox 1 year ago
parent
commit
0171228e0f
Signed by: virtubox GPG Key ID: 22EB296C97BAD476
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      mybashrc

+ 3
- 3
mybashrc View File

@ -498,14 +498,14 @@ _FTP_ADD() {
echo "Usage : ftpadd <user> <domain>"
else
if ! command_exists pwgen; then
apt_install pwgen
$NEED_SUDO apt-get install pwgen -y > /dev/null 2>&1
fi
ftpaccountpass=$(_PWGEN)
if [ -d /var/www/"$2"/htdocs ]; then
ftpaccountpass=$(_PWGEN)
$NEED_SUDO useradd -d "/var/www/$2/htdocs" -M -s /bin/false -G www-data "$1"
echo "$1:$ftpaccountpass" | $NEED_SUDO chpasswd -m
chmod -R g+rw "/var/www/$2/htdocs"
echo -e "\n\n [/var/www/$2/htdocs]" | tee -a "$HOME/.ftpaccounts"
echo -e "\n\n[/var/www/$2/htdocs]" | tee -a "$HOME/.ftpaccounts"
echo -e "user : $1" | tee -a "$HOME/.ftpaccounts"
echo "password : $ftpaccountpass" | tee -a "$HOME/.ftpaccounts"
else


Loading…
Cancel
Save