-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
executable file
·60 lines (53 loc) · 1.41 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
#!/bin/sh
# Install dependency
cd ~
sudo apt install -y \
php \
php-curl \
php-json \
php-mbstring \
php-mysql \
php-xml \
php-zip \
apache2 \
mysql-server \
python3-pip \
git \
composer \
sed
git clone https://github.com/udibagas/parking-system.git
sudo pip3 install python-escpos requests
cd parking-system
composer install
cp .env-prod .env
php artisan key:generate
php artisan jwt:secret
# prepare database server
sudo mysql -uroot -e 'create database parking_system'
sudo mysql -uroot -e 'grant all on parking_system.* to parking_system@localhost identified with mysql_native_password by Bismillah1@#$%"'
sudo mysql -uroot -e 'flush privileges'
# migrate then populate db
php artisan migrate
php artisan db:seed
# prepare document root
sudo mv /var/www/html /var/www/html-bak
sudo ln -s `pwd`/public /var/www/html
mkdir `pwd`/public/snapshot
chmod 777 `pwd`/public/snapshot
sudo chmod 777 storage -R
# prepare web server
sudo sed -i 172s/None/All/ /etc/apache2/apache2.conf
sudo a2enmod rewrite
# allow web to access serial & printer
sudo usermod -a -G dialout www-data
sudo usermod -a -G root www-data
sudo usermod -a -G lp www-data
sudo systemctl restart apache2
# upstart
chmod +x parking
sed -i "4 a DAEMON=`pwd`/parking.py" parking
sudo cp parking /etc/init.d/
chown root:root /etc/init.d/parking
sudo cp parking.conf /etc/init/
chown root:root /etc/init/parking.conf
reboot