aboutsummaryrefslogtreecommitdiffstats
path: root/modules/planet/templates/deploy_new-planet.sh
blob: 0c9307739c87440d0de0fa034cbe60a7826512fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

# Initialization
PATH_TO_FILE=${PATH_TO_FILE:-/var/lib/planet}
PATH_TO_PLANET=${PATH_TO_FILE:-/var/www/html/planet<%= domain %>}

#Ask for new locale name if no parameter given
echo -n "Locale name: "
read locale

# Display the answer and ask for confirmation
echo -e -n "Do you confirm the entry: \"$locale\"? (y/n) "
read answer
if [ "$answer" == "y" ] 
then
	FILE="$PATH_TO_FILE/$locale/"
	if test -d $FILE
	then
		echo "Aborted, $FILE already exist."
		exit 2
	else
		/bin/mkdir $FILE
	fi
else
	echo "Aborted, please try again."
	exit 2
fi