-
Notifications
You must be signed in to change notification settings - Fork 30
/
install.sh
56 lines (56 loc) · 1.79 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
#!/bin/bash
#URL: https://github.com/yushangcl/JetbrainsServer
#E-mail: [email protected]
clear
echo " ################################################"
echo " # #"
echo " # Build Jetbrains Server #"
echo " # https://blog.itbat.cn #"
echo " # Version 0.1.1 #"
echo " ################################################"
#Prepare the installation environment
echo -e ""
echo -e "Prepare the installation environment."
if cat /etc/*-release | grep -Eqi "centos|red hat|redhat"; then
echo "RPM-based"
yum -y install git
elif cat /etc/*-release | grep -Eqi "debian|ubuntu|deepin"; then
echo "Debian-based"
apt-get -y install git
else
echo "This release is not supported."
exit
fi
#Check instruction
if getconf LONG_BIT | grep -Eqi "64"; then
arch=64
else
arch=32
fi
#Build Jetbrains Server
git clone https://github.com/yushangcl/JetbrainsServer
if cat /etc/*-release | grep -Eqi "raspbian"; then
mv JetbrainsServer/binaries/IntelliJIDEALicenseServer_linux_arm jetbrains
else
if [ "$arch" -eq 32 ]; then
mv JetbrainsServer/binaries/IntelliJIDEALicenseServer_linux_i386 jetbrains
else
mv JetbrainsServer/binaries/IntelliJIDEALicenseServer_linux_amd64 jetbrains
fi
fi
mv jetbrains /usr/bin/
chmod +x /usr/bin/jetbrains
nohup jetbrains -p 1017 -u Bat.IT > /home/jetbrains.log 2>&1 &
echo -ne '\n@reboot root nohup jetbrains > /home/jetbrains.log 2>&1 &\n\n' >>/etc/crontab
#Cleaning Work
rm -rf JetbrainsServer
#Check jetbrains server status
sleep 1
echo "Check Jetbrains Server status..."
sleep 1
PIDS=`ps -ef |grep jetbrains |grep -v grep | awk '{print $2}'`
if [ "$PIDS" != "" ]; then
echo "jetbrains server is runing!"
else
echo "jetbrains server is NOT running!"
fi