if [ $host == undefined ]; then
	setup use dolphin
fi

# color is a another script
color bold $(color cyan  "\nWelcome to the ACS shell, Robert.")
if [ $host != undefined ]; then
	echo "Connected to" $(color magenta "$host\.");
	if [ $key != undefined ]; then
		$meta = $(json $(call users.query) meta)
		if [ $meta.code == 200 ]; then
			echo "Ready to use app" $(color magenta "$key\.")
		elif [ $meta.message == "Invalid app key" ]; then
			color bold $(color red "\nApp key $key is invalid!")
		else
			color bold $(color red "\nApp $key could not be reached succesfully!")
			if [ $meta.message != undefined ]; then
				color red "    Error: $meta.message"
			fi
		fi
		delete meta
	fi
fi
if [ $session != undefined ]; then
	color bold "\nCurrent login details:"
	whoami
else
	echo "\nAttempting studio login"
	$sl = $(sLogin)
	if [ $session != undefined ]; then
		whoami
	fi
	delete sl
fi
