Advertisement
Guest User

Untitled

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