-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstaller
More file actions
57 lines (45 loc) · 1.52 KB
/
Copy pathinstaller
File metadata and controls
57 lines (45 loc) · 1.52 KB
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
#!/usr/bin/env bash
if [[ $EUID -ne 0 ]]; then
echo " This script must be run as root"
echo " Please run 'sudo -s' then try again."
exit 1
fi
HERE=$(pwd)
clear
echo "Installing Browser-Mirror";
echo -ne '##### (33%) Initiating directory \r'
sleep .1
npm init -y &>/dev/null
echo -ne '############# (66%) Downloading dependencies\r'
sleep .1
npm install browser-mirror &>/dev/null
echo -ne '################## (75%) Installing \r'
sleep .1
mv ./node_modules/browser-mirror/bm-server ./bm-server
mv ./node_modules/browser-mirror/bm ./bm
chmod +x bm-server
chmod +x bm
echo -ne '##################### (80%) Installing manual \r'
sleep .1
if [ -d /usr/local/share/man/man1/ ]; then
cp ./node_modules/browser-mirror/bm.1 /usr/local/share/man/man1/
gzip /usr/local/share/man/man1/bm.1
elif [ -d /usr/share/man/man1 ]; then
cp ./node_modules/browser-mirror/bm.1 /usr/share/man/man1
gzip /usr/share/man/man1/bm.1
fi
[ -x "$(command -v mandb)" ] && mandb &>/dev/null
echo -ne '###################### (90%) Setting PATH \r'
sleep .1
if [ -f /etc/profile ]; then
printf '%s%s%s\n%s\n' 'export PATH="$PATH:' $HERE '"' "$(cat /etc/profile)" >/etc/profile
source /etc/profile
fi
echo -ne '######################## (95%) Creating logs \r'
sleep .1
touch logs.txt && chmod 777 logs.txt
touch .env && chmod 777 .env
echo "KEY=" >> .env
echo "CERT=" >> .env
echo "CA=" >> .env
echo -ne '######################### (100%) Done \n'