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

fix moving script

parent 175edcd8
No related branches found
No related tags found
No related merge requests found
......@@ -22,9 +22,9 @@ def setup(interactive=True):
'cp "%s/create_ftp_account.sh" /usr/local/bin' % (dir_path),
'mkdir -p /home/ftp/storage',
'mkdir -p /home/ftp/storage/incoming',
'mkdir -p /home/ftp/storage/hotfolder',
'mkdir -p /home/ftp/storage/watchfolder',
'chmod -R 775 /home/ftp/storage/incoming',
'chmod -R 775 /home/ftp/storage/hotfolder',
'chmod -R 775 /home/ftp/storage/watchfolder',
# Config
'echo "no" > /etc/pure-ftpd/conf/AllowDotFiles',
'echo "yes" > /etc/pure-ftpd/conf/CallUploadScript',
......
......@@ -10,7 +10,7 @@ import unicodedata
BASE_DIR = '/home/ftp/storage/'
INCOMING_DIR = BASE_DIR + 'incoming/'
DEST_DIR = BASE_DIR + 'hotfolder/'
DEST_DIR = BASE_DIR + 'watchfolder/'
ALLOWED_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-.'
LOG_FILE = '/home/ftp/on_ftp_upload.log'
......@@ -57,11 +57,6 @@ if __name__ == '__main__':
sys.exit(0)
dest_path = src_path.replace(INCOMING_DIR, DEST_DIR)
ftpuser = os.environ.get('UPLOAD_USER')
if ftpuser:
dest_path = os.path.join(dest_path, ftpuser)
else:
logging.warning('No ftp user specified, will move into generic folder %s' % dest_path)
if not os.path.exists(os.path.dirname(dest_path)):
os.system('mkdir -p -m 775 "%s"' % os.path.dirname(dest_path))
......
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