-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·44 lines (35 loc) · 1.28 KB
/
install
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
#!/usr/bin/env bash
# Install script for Ubuntu
# Run as root
if [ "$EUID" -ne 0 ];
then echo "Please run as root"
exit 1
fi
set -eu
#add-apt-repository universe
#apt-get update
#apt-get install build-essential cpanminus libterm-readline-gnu-perl libdbi-perl sqlite3 libsqlite3-dev libtie-ixhash-perl liblist-allutils-perl libmoo-perl libalgorithm-combinatorics-perl libdigest-sha-perl libsql-abstract-perl libev-perl libdbd-sqlite3-perl libmojolicious-perl -y
#cpanm -S AnyEvent::ReadLine::Gnu Poker::Eval Poker::Robot
INSTALL_PATH=/opt
BIN_PATH=/usr/local/sbin
cp -R ./mojopoker-1.1.0 $INSTALL_PATH
ln -sfn $INSTALL_PATH/mojopoker-1.1.0 $INSTALL_PATH/mojopoker
ln -sf $INSTALL_PATH/mojopoker-1.1.0/script/mpadmin.pl $BIN_PATH
ln -sf $INSTALL_PATH/mojopoker-1.1.0/script/wsshell.pl $BIN_PATH
#cd $INSTALL_PATH/mojopoker/db
#sqlite3 fb.db < fb.schema
#sqlite3 poker.db < poker.schema
#chmod 666 *
chmod 755 $INSTALL_PATH/mojopoker/script/*
# start with systemd
cp $INSTALL_PATH/mojopoker/systemd/* /etc/systemd/system/
systemctl daemon-reload
systemctl enable mojopoker
echo
echo "Installation complete!"
echo
echo "To start the server:"
echo "sudo systemctl start mojopoker.service"
echo
echo "To load a few sample games:"
echo "/opt/mojopoker/script/wsshell.pl < /opt/mojopoker/db/example_games"