Skip to content

Instantly share code, notes, and snippets.

@dkavraal
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dkavraal/8058a11dc677a7e5e29a to your computer and use it in GitHub Desktop.
Save dkavraal/8058a11dc677a7e5e29a to your computer and use it in GitHub Desktop.
a few bash helper
alias cp='rsync -p --progress'
# copy with progressbar
#!/bin/bash
PWD=~/Downloads
ls > /dev/null # if any case. avoid to kill self
while true; do
/usr/bin/aria2c -c -x14 -s14 http://...
PID=$!
echo $PID
sleep 25
while [[ $( ps -ef | grep -e aria2c -e "##############" | grep -v "#####" | wc -l ) > 0 ]]; do
echo "waiting aria to die..."
kill $PID
sleep 3
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment