#!/bin/rc
#
#
rfork ne
fn whoami{
	ps|tail -1|awk '{print $1}'
}
if(! ~ $#* 0){
	echo 'usage: mksitemap'
	exit
}
cd /doc
if(! test -e sitemap.conf){
	echo 'sitemap.conf not exist'
	exit
}
who=`{whoami}
if(! ~ $who web){
	echo 'this program should be executed as user web'
	exit
}

sitemapgen sitemap.conf > sitemap.xml
#gzip sitemap.xml
echo done
