#!/bin/bash cwd=$(pwd) echo -e "AVR Toolchain packer v1.0\n" if (( $EUID != 0 )); then echo -e "$(tput setaf 11)This must be run as root. Try 'sudo bash $0'.$(tput setaf 7)\n" exit 1 fi if ! [ -x "$(command -v pv)" ] then sudo apt-get install pv -y fi if ! [ -x "$(command -v pixz)" ] then sudo apt-get install pixz -y fi echo "Compressing:" cp -r -f /usr/local/avr . SIZE=`du -sk avr | cut -f 1` tar cf - avr | pv -p -s ${SIZE}k | pixz > avr_toolchain.tar.xz rm -r -f avr echo -e "\nDone."