Skip to content

Instantly share code, notes, and snippets.

@unixfox
Created December 8, 2016 10:42
Show Gist options
  • Save unixfox/596ab12a63f498e57a7871caab3d1db3 to your computer and use it in GitHub Desktop.
Save unixfox/596ab12a63f498e57a7871caab3d1db3 to your computer and use it in GitHub Desktop.
Automaticaly upload asciinema json file to the official website (related to honssh)
#!/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