forked from evo42/_runty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·81 lines (58 loc) · 1.81 KB
/
install.sh
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/sh
set -e
set -u
# Let's display everything on stderr.
exec 1>&2
UNAME=`uname`
if [ "$UNAME" != "Linux" -a "$UNAME" != "Darwin" ] ; then
echo "Sorry, this OS is not supported yet. Please install Runty. The NoCMS manually using this guide: http://runty.io/guides/installation"
exit 1
fi
trap "echo Installation failed." EXIT
# remove old runty directory
[ -e "runty" ] && rm -rf "runty"
# This is the CloudFront CDN serving com.meteor.warehouse.
#ZIP_URL="https://github.com/evo42/runty/archive/installer.zip"
TARBALL_URL="https://codeload.github.com/evo42/runty/tar.gz/installer"
#TARBALL_URL="http://apa.runty/installer.tar.gz"
INSTALL_TMPDIR=".runty-install-tmp"
sudo rm -rf "$INSTALL_TMPDIR"
sudo mkdir "$INSTALL_TMPDIR"
echo ""
echo "Downloading Runty. The NoCMS"
sudo curl --progress-bar --fail "$TARBALL_URL" | sudo tar -xzf - -C "$INSTALL_TMPDIR"
# bomb out if it didn't work, eg no net
test -x "${INSTALL_TMPDIR}/runty-installer/runty/app.js"
sudo mv "${INSTALL_TMPDIR}/runty-installer/runty" "./runty"
sudo rm -rf "${INSTALL_TMPDIR}"
# double-checking
test -x "runty/app.js"
# create uploads folder
if [ -e "./uploads" ] ; then
# do not remove uploads dir
echo "Uploads directory exists."
else
# create empty uploads dir
echo "Create ./uploads directory."
mkdir ./uploads
fi
# copy config files
sudo mv runty/aloha-editor.js.example ./aloha-editor.js
sudo mv runty/user.json.example ./user.json
# chown
if [ "$UNAME" = "Darwin" ] ; then
### OSX ###
CHOWN="_www:staff"
elif [ "$UNAME" = "Linux" ] ; then
### Linux ###
CHOWN="www-data:www-data"
fi
sudo chmod -R 755 ./*
sudo chown -R "$CHOWN" ./*
echo "Runty. The NoCMS has been installed."
cat <<"EOF"
Sign in to http://<your-domain.com>/runty to start editing pages.
Or see the docs at:
http://runty.io/guides
EOF
trap - EXIT