Deactivate htaccess login via crontab
Lets imagine you had a .htaccess authentication like that:
1 2 3 4 5 6 7 |
AuthUserFile /var/www/vhosts/ask-sheldon.com/.htpasswd AuthGroupFile /dev/null AuthName "Sheldons Secret" AuthType Basic <Limit GET> require valid-user </Limit> |
… and a corresponding password file, you can deactivate the password prompt on 31.12.2014 at 23:59 automatically with this crontab entry:
1 2 3 |
# remove htaccess password protection on 31.12.2014 MAILTO = mustang@snsconsulting.de 59 23 31 12 * sed -i 's/require valid-user/#require valid-user/g' /var/www/vhosts/ask-sheldon.com/.htaccess |