Created
December 8, 2016 10:42
-
-
Save unixfox/596ab12a63f498e57a7871caab3d1db3 to your computer and use it in GitHub Desktop.
Automaticaly upload asciinema json file to the official website (related to honssh)
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 | |
DATE="$(date +%s)" | |
file=$3 | |
minimumsize=5 | |
actualsize=$(du -k "$file" | cut -f 1) | |
if [ $actualsize -ge $minimumsize ]; then | |
/usr/share/.configuration/honssh/utils/asciinema.py -t "$3" "$3" > asciinema-upload/asciinema-upload-"$DATE".json | |
/usr/bin/asciinema upload asciinema-upload/asciinema-upload-"$DATE".json || exit 1 | |
rm asciinema-upload/asciinema-upload-"$DATE".json | |
else | |
echo "echo size is under $minimumsize kilobytes" > asciinema-upload/asciinema-upload-"$DATE".json | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment