Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. post_check /bin/zipscript [path mask]
  2. post_check runs AFTER an upload finishes
  3.  
  4. post_check can be defined multiple times. Path mask is optional; if
  5. present, glftpd will only execute this script if the path mask matches
  6. the full path to where the file was uploaded. If the path doesn't
  7. match, glftpd will try to find another post_check declaration whose
  8. path does match, or one that doesn't have a path mask.
  9.  
  10. Example:
  11. post_check none /site/public/* # disables zipscript in /site/public
  12. post_check /bin/special.sh /site/special/* # special zipscript
  13. post_check /bin/zipscript * # normal zipscript for all other paths
  14.  
  15. If you want to enable upload resume in a certain path, you should
  16. disable the zipscript for that path, so that partial files are not
  17. deleted when the uploader loses connection.
  18.  
  19. The post_check script receives 3 parameters from glftpd:
  20. $1 - the name of file uploaded
  21. $2 - the directory the file was uploaded to
  22. $3 - the CRC code of that file (if calc_crc was enabled, or 000000 otherwise)
  23. NOTE: If the uploader times out the CRC code will also be 000000, this to
  24. prevent that if one reconnected and started uploading the same file
  25. again but left an stalled upload session alive a bad crc would be passed,
  26. and the file would get deleted.
  27.  
  28. If zipscript exits with 1 or 127, glftpd assumes there was a problem executing
  29. it. The file will not be deleted or unduped.
  30. If zipscript exits with anything bigger than 1, glftpd will assume that the
  31. file uploaded was bad and it will be deleted, the user's credits and stats will
  32. not be added, and the file will be removed from the dupe database.
  33.  
  34. If zipscript exits with a number between 10 and 1010, glftpd will "sleep" for that
  35. many seconds minus 10 before continuing. This might be helpful if you want to
  36. prevent people from uploading a file that is being uploaded to their system over
  37. and over until it is complete.
  38. ex. To make a user wait 10 seconds after uploading a bad file, exit with 20.
  39. NOTE: exit code 127 is exempted: it will NOT cause a delay, it will be
  40. treated like exit code 1 instead.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement