-
Notifications
You must be signed in to change notification settings - Fork 1
/
debian-ss
56 lines (44 loc) · 2.13 KB
/
debian-ss
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
APX=http://soft.91yun.org/soft/serverspeeder/apx1.php
#安装包下载地址
INSTALLPACK=http://soft.91yun.org/soft/serverspeeder/91yunserverspeeder.tar.gz
#bin下载地址
BIN=http://soft.91yun.org/soft/serverspeeder/bin/Debian/7/3.2.0-4-686-pae/x32/3.10.61.0/serverspeeder_2623
#先取外网ip,根据取得ip获得网卡,然后通过网卡获得mac地址。
MAC=`ifconfig eth0 | awk '/HWaddr/{ print $5 }'`
#安装curl
yum -y install curl || { apt-get update;apt-get install -y curl; } || { echo "curl自动安装失败,请自行手动安装curl后再重新开始";exit 1; }
#下载安装包
echo "======================================"
echo "开始下载安装包。。。。"
echo "======================================"
wget -O 91yunserverspeeder.tar.gz $INSTALLPACK
tar xfvz 91yunserverspeeder.tar.gz || { echo "下载安装包失败,请检查";exit 1; }
#下载授权文件
echo "======================================"
echo "开始下载授权文件。。。。"
echo "======================================"
curl "$APX?mac=$MAC" -o 91yunserverspeeder/apxfiles/etc/apx-20341231.lic || { echo "下载授权文件失败,请检查";exit 1;}
#取得序列号
echo "======================================"
echo "开始修改配置文件。。。。"
echo "======================================"
SNO=$(curl "$APX?mac=$MAC&sno") || { echo "生成序列号失败,请检查";exit 1; }
echo "序列号:$SNO"
sed -i "s/serial=\"sno\"/serial=\"$SNO\"/g" 91yunserverspeeder/apxfiles/etc/config
rv=Debian_7_3.2.0-4-686-pae
sed -i "s/Debian_7_3.2.0-4-amd64/$rv/g" 91yunserverspeeder/apxfiles/etc/config
#下载bin文件
echo "======================================"
echo "开始下载bin运行文件。。。。"
echo "======================================"
curl $BIN -o 91yunserverspeeder/apxfiles/bin/acce-3.10.61.0-[Debian_7_3.2.0-4-686-pae] || { echo "下载bin运行文件失败,请检查";exit 1; }
#切换目录执安装文件
cd 91yunserverspeeder
bash install.sh
#禁止修改授权文件
chattr +i /serverspeeder/etc/apx*
#安装完显示状态
bash /serverspeeder/bin/serverSpeeder.sh status