#!/bin/bash # htmlredirect - create static html redirect page to new url if [ "$1" == "-h" ]; then cat << EOT htmlredirect v0.2 - create static html redirect page to new url (c) 2005 Tero Karvinen http://www.iki.fi/karvinen/ http://www.iki.fi/karvinen/htmlredirectpage/ Usage: htmlredirect [newurl] htmlredirect [old relative url] [newurl] ChangeLog: 2005-11-19t0903 Created EOT exit 0; fi if [ -z "$1" ]; then echo "Use -h for help."; exit 1; fi OPWD=`pwd`; if [ -z "$2" ]; then NEWURL="$1"; else DIR=$1; NEWURL="$2"; if [ -e "$DIR" ]; then echo "Allready exists folder $DIR. Exiting. "; exit 2; else mkdir $DIR && echo "Created directory $DIR."; cd $DIR; fi fi if [ -e "index.html" ]; then echo "Allready exists index.html. Exiting."; exit 2; fi cat << EOT > index.html Moved...

Moved...

Moved to http://www.iki.fi/karvinen. You will be automacally redirected in 3 seconds.

EOT perl -p -i -e "s|http://www.iki.fi/karvinen|$NEWURL|g" index.html; cd $OPWD;