Created
April 9, 2020 15:49
-
-
Save yumetodo/0ba0ee0852b43cd081e3484dfbe3d01a to your computer and use it in GitHub Desktop.
Elecom WRC-2533GHBK-lのログを取得してgitで管理するスクリプト
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 | |
# --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