diff --git a/10.MediaFolder/2.Install_FTP_watch_folder/0_setup.py b/10.MediaFolder/2.Install_FTP_watch_folder/0_setup.py index 4739c0fedbaf932579d1f95f1fc38eb390c8a939..db9c144da6bf27b9d8bfcf82ec2f33806b17dd77 100644 --- a/10.MediaFolder/2.Install_FTP_watch_folder/0_setup.py +++ b/10.MediaFolder/2.Install_FTP_watch_folder/0_setup.py @@ -56,7 +56,7 @@ def setup(interactive=True): cmds.extend([ 'mkdir -p /home/ftp/storage/incoming/%s' % folder, 'mkdir -p /home/ftp/storage/watchfolder/%s' % folder, - '"%s/create_ftp_account.sh" %s "%s" /home/ftp/storage/incoming/%s' % (dir_path, login, password, login), + '"%s/create_ftp_account.sh" %s "%s"' % (dir_path, login, password), ]) cmds.extend([ 'chmod -R 775 /home/ftp/storage/incoming', diff --git a/10.MediaFolder/2.Install_FTP_watch_folder/create_ftp_account.sh b/10.MediaFolder/2.Install_FTP_watch_folder/create_ftp_account.sh index a04ded37c58efbdaeed2fe722dc1c585a8bc3c9d..54d27ddfa989b86deace26de3f8a286364011d19 100755 --- a/10.MediaFolder/2.Install_FTP_watch_folder/create_ftp_account.sh +++ b/10.MediaFolder/2.Install_FTP_watch_folder/create_ftp_account.sh @@ -1,4 +1,13 @@ #!/bin/bash +if [ $# -le 1 ] +then + echo "Usage: create_account.sh username password" + exit 1 +fi -# Usage: create_account.sh username password home -echo -e "$2\n$2" | pure-pw useradd $1 -u ftp -d $3 +mkdir -p /home/ftp/storage/incoming/$1 +mkdir -p /home/ftp/storage/watchfolder/$1 +echo -e "$2\n$2" | pure-pw useradd $1 -u ftp -d /home/ftp/storage/incoming/$1 +chmod -R 775 /home/ftp/storage/incoming +chmod -R 775 /home/ftp/storage/watchfolder +chown -R ftp:ftp /home/ftp/storage