grep Auth .htaccess >&/dev/null &&
echo "There is already a Auth section in your .htaccess file, aborting." ||
{ cat >> .htaccess <<EOF
AuthUserFile $PWD/.htpasswd
AuthName "Private Area"
AuthType Basic
require valid-user
EOF
echo "Auth section added to your .htaccess file."
}
touch .htpasswd
htpasswd -mb .htpasswd yourlogin yourpassword