-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplay226.sh
35 lines (34 loc) · 987 Bytes
/
play226.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
#!/bin/bash
if [ -d "/usr/share/play" ]
then
echo "Play already installed, nothing done!"
else
SETUP="/vagrant/vagrant-setup"
source $SETUP/include.sh
PPWD=$PWD
cd /usr/share
if getent passwd play > /dev/null 2>&1; then
echo "play user already exists"
else
# Create a user for Play
groupadd play
useradd -d /usr/share/play/ -K MAIL_DIR=/dev/null -g play play
echo -e "PlayFrm22\nPlayFrm22\n" | passwd play
fi
wget_and_unzip http://downloads.typesafe.com/play/2.2.6/ play-2.2.6.zip
mv play-2.2.6 play
cd play
chown -Rf play.play .
chmod -f -R 774 .
if grep -Fq "/usr/share/play" ~/.bash_profile
then
echo "~/.bash_profile already contains /usr/share/play in PATH"
else
perl -pi -e "s/PATH=\x24PATH:/PATH=\x24PATH:\x2Fusr\x2Fshare\x2Fplay:/g" ~/.bash_profile
fi
iptables -A INPUT -p tcp --dport 8888 -j ACCEPT
iptables -A INPUT -p tcp --dport 9000 -j ACCEPT
service iptables save
systemctl restart iptables
cd $PPWD
fi