1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/usr/bin/zsh dump_url="$1" dump_file=$(basename "${dump_url%.bz2}") if [[ ! -f "${dump_file}.bz2" && ! -f "${dump_file}" ]]; then wget "${dump_url}" fi if [ ! -f "${dump_file}" ]; then bunzip2 -d "${dump_file}.bz2" fi