oldhtpasswd=$( cd /usr/local/etc/freeside; \
ls |grep -P 'htpasswd_\d{8}' | \
sort -nr |head -1 )
- if [ -f $oldhtpasswd ]; then
+ if [ -f /usr/local/etc/freeside/$oldhtpasswd ]; then
echo "Renaming $oldhtpasswd to htpasswd."
sudo mv /usr/local/etc/freeside/$oldhtpasswd \
/usr/local/etc/freeside/htpasswd
if [ -n "$oldname" ]; then
echo "Renaming $oldname to freeside."
psql postgres -c "ALTER DATABASE $oldname RENAME TO freeside"
- echo "Restarting services."
- sudo service apache2 restart
- sudo service freeside restart
fi
echo "Done."