add license
make bash script more flexible