-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
iansiu
committed
Mar 6, 2016
1 parent
49e1ee7
commit d883216
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/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/CentOS/6.6/2.6.32-504.el6.i686/x32/3.10.61.0/serverspeeder_2718 | ||
|
||
|
||
|
||
##### 获取eth0的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 $INSTALLPACK -O 91yunserverspeeder.tar.gz | ||
tar xf 91yunserverspeeder.tar.gz || { echo "下载安装包失败,请检查";exit 1; } | ||
|
||
##### 下载授权文件 | ||
|
||
echo "======================================" | ||
echo "开始下载授权文件。。。。" | ||
echo "======================================" | ||
wget "$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=CentOS_6.6_2.6.32-504.el6.i686 | ||
sed -i "s/Debian_7_3.2.0-4-amd64/$rv/g" 91yunserverspeeder/apxfiles/etc/config | ||
|
||
##### 下载bin文件 | ||
|
||
echo "======================================" | ||
echo "开始下载bin运行文件。。。。" | ||
echo "======================================" | ||
wget $BIN -O 91yunserverspeeder/apxfiles/bin/acce-3.10.61.0-[CentOS_6.6_2.6.32-504.el6.i686] || { echo "下载bin运行文件失败,请检查";exit 1; } | ||
|
||
#切换目录执安装文件 | ||
|
||
cd 91yunserverspeeder | ||
bash install.sh | ||
|
||
#禁止修改授权文件 | ||
|
||
chattr +i /serverspeeder/etc/apx* | ||
|
||
#安装完显示状态 | ||
sed -i 's/advinacc="0"/advinacc="1"/g' /serverspeeder/etc/config && /serverspeeder/bin/serverSpeeder.sh restart | ||
bash /serverspeeder/bin/serverSpeeder.sh status |