Style consistency fixes around bin/aux/* and bin/contrib/*
This commit is contained in:
parent
8c10f7653a
commit
14c33b7110
@ -8,38 +8,38 @@ fn die {
|
||||
exit 1
|
||||
}
|
||||
|
||||
if (~ $#* 0)
|
||||
if(~ $#* 0)
|
||||
die 'Missing title'
|
||||
|
||||
if(~ $#user 0)
|
||||
user = `{whoami}
|
||||
user=`{whoami}
|
||||
|
||||
file = (); title = ();
|
||||
bloguser = $user
|
||||
file=(); title=();
|
||||
bloguser=$user
|
||||
while(! ~ $#* 0) {
|
||||
switch($1) {
|
||||
case -u
|
||||
base=/gsoc/www/people/$user/blog/
|
||||
shift
|
||||
case *
|
||||
title = $"*
|
||||
title=$"*
|
||||
}
|
||||
shift
|
||||
}
|
||||
|
||||
date=`{/bin/date +%F}
|
||||
|
||||
n = 1
|
||||
n=1
|
||||
for(f in $base/$date-*) {
|
||||
i = `{echo $f | sed -n 's|^.*/'$date'-([0-9]+)_.*|\1|p'}
|
||||
i=`{echo $f | sed -n 's|^.*/'$date'-([0-9]+)_.*|\1|p'}
|
||||
if(! ~ $#i 0 && test $i -ge $n)
|
||||
n = `{hoc -e $i'+1'}
|
||||
n=`{hoc -e $i'+1'}
|
||||
}
|
||||
|
||||
if(~ $EDITOR '')
|
||||
EDITOR = vi
|
||||
EDITOR=vi
|
||||
|
||||
file = $home/.blogtmp.$pid
|
||||
file=$home/.blogtmp.$pid
|
||||
rm $file >[2]/dev/null
|
||||
touch $file
|
||||
$EDITOR $file
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env rc
|
||||
# DEPRECATED: sitemap.tpl now generates and updates a sitemap.txt when requested, and is also more smart than this simplistic script.
|
||||
|
||||
for ( d in sites/*/ ) {
|
||||
for(d in sites/*/) {
|
||||
echo $d
|
||||
9 du -a $d | awk '/\.(md|html)$/ { print $2 }; {}' | 9 sed -e 's/\.(md|html)$//' -e 's,/index$,/,' -e 's,^sites/,http://,' > $d/sitemap.txt
|
||||
|
||||
|
@ -3,28 +3,28 @@
|
||||
# A web server in rc by maht
|
||||
# Originally from http://www.proweb.co.uk/~matt/rc/webserver.rc
|
||||
|
||||
ifs = ' '
|
||||
request = `{sed 1q}
|
||||
ifs=' '
|
||||
request=`{sed 1q}
|
||||
|
||||
url = $request(2)
|
||||
file = `{echo $url | sed 's/http:\/\/[^\/]*//' | tr -d \012}
|
||||
url=$request(2)
|
||||
file=`{echo $url | sed 's/http:\/\/[^\/]*//' | tr -d \012}
|
||||
|
||||
if(test -d $file){
|
||||
file = $file ^'/index.html'
|
||||
file=$file ^'/index.html'
|
||||
}
|
||||
if (test -e $file) {
|
||||
response = '200'
|
||||
if(test -e $file) {
|
||||
response='200'
|
||||
}
|
||||
if not {
|
||||
response = '404'
|
||||
file = '404.html'
|
||||
response='404'
|
||||
file='404.html'
|
||||
}
|
||||
|
||||
echo 'HTTP/1.1 ' ^$response
|
||||
echo 'Date: ' `{date}
|
||||
echo 'Server: rc shell'
|
||||
echo 'Content-Length: ' `{cat $file | wc -c | tr -d ' '}
|
||||
echo 'Content-Type: ' `{file -i $file | awk ' { print $2 } '}
|
||||
echo 'Content-Type: ' `{file -i $file | awk '{ print $2 }'}
|
||||
echo 'Connection: close'
|
||||
echo
|
||||
cat $file
|
||||
|
Loading…
Reference in New Issue
Block a user