Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #!/bin/bash
  2. #Absolute path to the file containing the notes (inside an SSH-cloned repository)
  3. fileDIR=/home/juani/Documentos/journal/misc/
  4. FILENAME=notes.md
  5. ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` > /dev/null && (cd $fileDIR && git pull) || echo 'Error, no hay conexion a internet, no se pudo pullear'
  6. cd $FILEDIR
  7. echo "* "$1" " >> $fileDIR$FILENAME
  8. ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` > /dev/null && (cd $fileDIR && git add . && git commit -m "autoCommit" && git push) || echo 'Error, no hay conexion a internet, no se pudo pushear'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement