summaryrefslogtreecommitdiff
path: root/setup.sh
blob: 0ef2994099a0984d96fc0c4286f48e5b0fd4b57e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
set -e
if [ -z $UPLOAD_DIR ]; then
#	echo "Please provide env variable '\$UPLOAD_DIR'." 1>&2
#	exit 1
	echo "Using $(pwd)/files as default for \$UPLOAD_DIR..."
	export UPLOAD_DIR=$(pwd)/files
fi

mkdir -p $UPLOAD_DIR

cd $UPLOAD_DIR && \
	ln -s original i && \
	cd ..

if [ ! -f "config/conf.json" ]; then
	cd config && \
		cp default.conf.json conf.json && \
		cd ..
	sed -i "s|/Users/jarvis/imagestore|$UPLOAD_DIR|" config/conf.json
fi