Skip to content

Instantly share code, notes, and snippets.

@yumetodo
Created April 9, 2020 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yumetodo/0ba0ee0852b43cd081e3484dfbe3d01a to your computer and use it in GitHub Desktop.
Save yumetodo/0ba0ee0852b43cd081e3484dfbe3d01a to your computer and use it in GitHub Desktop.
Elecom WRC-2533GHBK-lのログを取得してgitで管理するスクリプト
#!/bin/bash
# --no-gpg-sign
curl -u admin:zlu9jhmhk5qqbb5k_cheh4itwoxdq7 http://192.168.2.1/tmp_logmsg.log > raw.log
if [ $(wc -l < raw.log) -lt 1 ]; then
wc -l < raw.log
git reset --hard HEAD
else
if git add raw.log; then
if git commit -m "update" --no-gpg-sign; then
echo "updated"
else
echo "no change from previous"
fi
else
git status
echo "no change from previous"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment