install.sh: reduce nonfunctional update window
When renaming dir to dir-old and then dir-new to dir there's a small
window of opportunity after the rename of dir to dir-old before the
rename of dir-new to dir completes during which things will be possibly
be nonfunctional.
Rather than using two separate "mv" invocations in the shell, use two
rename calls in a Perl script. By using Perl there's guaranteed to be
only the one process involved and the two calls should happen with
practically no delay between them thus reducing the window of
opportunity to practically its smallest possible size.
Until an atomic directory rename/exchange comes along this is probably
the best that can be done short of changing things to use a symbolic
link in the directory path somewhere which can be atomically replaced.
Since some web servers go to great lengths to avoid following symbolic
links such a change would likely impact web server configuration too.
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>