#!/bin/sh

# Simple case: it exists and it's a directory
if test -d $1; 
then {
	if chmod -R u+rwX,go= $1;
	then
		exit 0;
	else
		exit 1;
	fi;
} fi

# Harder case: it exists, but isn't a directory
if test -e $1; 
then
	exit 2
fi

# Doesn't exist
if mkdir -m u+rwX,go= $1;
then
	exit 0;
else 
	exit 2;
fi
