Last active
October 22, 2016 21:03
-
-
Save juanisierra/764818dd52099e2dc8a9d58e3436a19e to your computer and use it in GitHub Desktop.
Adds short notes into github repositories and auto-commits them
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Absolute path to the file containing the notes (inside an SSH-cloned repository) | |
fileDIR=/home/juani/Documentos/journal/misc/ | |
FILENAME=notes.md | |
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' | |
cd $FILEDIR | |
echo "* "$1" " >> $fileDIR$FILENAME | |
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' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment