updated to work better on distros that don't expect sh to symlink to bash