Skip to content
Snippets Groups Projects
Commit 98933c26 authored by Florent Thiery's avatar Florent Thiery
Browse files

auto create folders in create_ftp_account.sh

parent 503f8a25
No related branches found
No related tags found
No related merge requests found
......@@ -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',
......
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment