Bug#396782: apache2.2-common: Upgrade adds "default" virtual host; breaks existing config
* Peter Samuelson (peter@p12n.org) [061111 23:07]:
>
> [Andreas Barth]
> > I propose to change this check
> > if [ ! -L /etc/apache2/sites-enabled/000-default -a \
> > ! -f /etc/apache2/sites-enabled/000-default ]; then
> > ln -s /etc/apache2/sites-available/default /etc/apache2/sites-enabled/000-default
> > fi
> > to
> > if [ ! -L /etc/apache2/sites-enabled/000-default -a \
> > ! -f /etc/apache2/sites-enabled/000-default -a] && \
> ^^^typo
> > [ $(find /etc/apache2/sites-enabled/ -mindepth 1 -type f -o -type l | wc -l) -eq 0 ]; then
> > ln -s /etc/apache2/sites-available/default /etc/apache2/sites-enabled/000-default
> > fi
>
> I don't understand the need for -mindepth since it we're specifically
> looking for "-type f -o -type l". Anyway, I'll stare at it a bit and
> do something similar to what you propose.
I'm not too sure if -mindepth is required as well, but I'm quite
confident it doesn't hurt. I stole the find from one of my shell scripts
which had -mindepth and -maxdepth.
Cheers,
Andi
--
http://home.arcor.de/andreas-barth/
Reply to: