-
Notifications
You must be signed in to change notification settings - Fork 13
/
kms.sh
41 lines (41 loc) · 1.39 KB
/
kms.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
#!/bin/bash
#URL: https://github.com/uselibrary/KMS_Server
#E-mail: [email protected]
clear
echo " ################################################"
echo " # #"
echo " # Build KMS Server #"
echo " # https://pa.ci #"
echo " # Version 0.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"; then
echo "Debian-based"
apt-get -y install git
else
echo "This release is not supported."
exit
fi
#Build KMS Server
git clone https://github.com/uselibrary/KMS_Server
mv KMS_Server vlmcsd
mv vlmcsd /usr/local/
mkdir /usr/local/KMS/
ln -sv /usr/local/vlmcsd/ /usr/local/KMS/
echo "export PATH=/usr/local/KMS/vlmcsd/binaries/Linux/intel/static:\$PATH" > /etc/profile.d/vlmcs.sh
source /etc/profile.d/vlmcs.sh
chmod +x /usr/local/KMS/vlmcsd/binaries/Linux/intel/static/*
echo "vlmcsd-x64-musl-static" >> /etc/rc.local
vlmcsd-x64-musl-static
#Check vlmcsd status
PIDS=`ps -ef |grep vlmcsd |grep -v grep | awk '{print $2}'`
if [ "$PIDS" != "" ]; then
echo "vlmcsd is runing!"
else
echo "vlmcsd is NOT running!"
fi