#!/bin/sh

if [ "$1" = "cron" ]; then
	if [ "$2" != "" ]; then
		php __application__/cronjobs/index.php $2
	else
		echo "Enter the file to run."
	fi
elif [ "$1" = "logs" ]; then
	if [ "$2" != "remove" ]; then
		if [ "$3" != "" ]; then
			if [ "$3" = "all" ]; then
				rm -Rf __logs__ && mkdir -m 775 __logs__
			else
				cd __logs__ && rm -Rf $3
			fi
		else 
			echo "Specify the year of the log to be removed"
		fi
	fi
fi