Last active
January 2, 2016 05:09
-
-
Save MasWag/8255597 to your computer and use it in GitHub Desktop.
mikoラジのスクリプト
This file contains hidden or 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
| *~ | |
| cache |
This file contains hidden or 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 | |
| ## configs | |
| #DESTDIR="/Volume/NO\ NAME/miko" | |
| DESTDIR="/run/media/calros/30A3-239E/miko" | |
| mkdir -p ./cache | |
| for a in miko-*.mp3 ; do | |
| cp $a "$DESTDIR"; | |
| if [ $? -eq 0 ]; then | |
| mv $a ./cache; | |
| fi | |
| done |
This file contains hidden or 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 | |
| LASTVER=$(cat VER.log) | |
| git pull | |
| # if LASTVER include . , split to MAJORVER and MINORVER | |
| if [[ $LASTVER =~ \. ]] ; then | |
| MAJORVER=${LASTVER%.*}; | |
| MINORVER=${LASTVER#*.}; | |
| else | |
| MAJORVER=${LASTVER}; | |
| MINORVER=0; | |
| fi | |
| curl -L "http://soundcloud.com/iosysos/miko-0$MAJORVER$(( $MINORVER + 1))/download.mp3" -o "miko-$MAJORVER.$(( $MINORVER + 1)).mp3" | |
| if [[ $( file miko-$MAJORVER.$(( $MINORVER + 1)).mp3) =~ Audio ]] ; then | |
| echo "${MAJORVER}.$(( $MINORVER + 1))" > VER.log | |
| else | |
| rm miko-$(( $MAJORVER)).$(( $MINORVER + 1)).mp3 | |
| curl -L "http://soundcloud.com/iosysos/miko-0$(( $MAJORVER + 1))/download.mp3" -o "miko-$(( $MAJORVER + 1)).mp3" | |
| if [[ $( file miko-$(($MAJORVER + 1)).mp3 ) =~ Audio ]] ; then | |
| echo $(( $MAJORVER + 1)) > VER.log | |
| else | |
| rm miko-$(($MAJORVER + 1)).mp3 | |
| fi | |
| fi | |
| git add VER.log | |
| git ci -m "auto update: VER.log" | |
| git push |
This file contains hidden or 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
| 183 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment