Advertisement
Guest User

Untitled

a guest
Feb 12th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. #!/bin/bash
  2. exec 2>&1 /tmp/cron-out.log
  3.  
  4.  
  5. #/**
  6. # * @file run.sh
  7. # * @brief just start WebGrab+Plus
  8. # * @author Francis De Paemeleere
  9. # * @date 31/07/2016
  10. # */
  11.  
  12. #backup the current working dir
  13. WG_BCKP_DIR="$(pwd)"
  14.  
  15. function quit {
  16. #restore previous working dir
  17. cd "$WG_BCKP_DIR"
  18. exit $1;
  19. }
  20.  
  21. # check if mono can be found
  22. which mono >/dev/null 2>&1 || { echo >&2 "Mono required, but it's not installed."; quit 1; }
  23.  
  24. # get the absolute path of the link (or relative path)
  25. if [ -L $0 ] ; then
  26. DIR=$(dirname $(readlink -f $0)) ;
  27. else
  28. DUTDIR=$(dirname $0) ;
  29. if [ "${DUTDIR:0:1}" = "/" ]; then
  30. DIR="$DUTDIR";
  31. else
  32. DIR=$PWD/$(dirname $0) ;
  33. fi
  34. fi ;
  35.  
  36. mono "$DIR/bin/WebGrab+Plus.exe" "$DIR"
  37.  
  38. #!/bin/sh -x
  39. cd /root/x/
  40. HOST='ftp.server.com'
  41. PORT='21'
  42. USER='xxxxxx'
  43. PASSWORD='xxxxxx'
  44. FILE='xxxxx.xml'
  45. ftp -n $HOST $PORT <<END_SCRIPT
  46. quote USER $USER
  47. quote PASS $PASSWORD
  48. put $FILE
  49. quit
  50. END_SCRIPT
  51. exit 0
  52.  
  53. quit 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement