From 0171228e0f8501312c22857fd6d527d58f2565c0 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Thu, 2 Jan 2020 12:31:59 +0100 Subject: [PATCH] fix ftp_add --- mybashrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mybashrc b/mybashrc index e0efd77..7a1f529 100644 --- a/mybashrc +++ b/mybashrc @@ -498,14 +498,14 @@ _FTP_ADD() { echo "Usage : ftpadd " 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