阿里云的一个安装脚本
来源:互联网 发布:555计时器端口 编辑:程序博客网 时间:2024/04/29 14:51
#!/bin/bash
if [ `uname -m` = "x86_64" ]; then
ARCH="linux64"
else
ARCH="linux32"
fi
AEGIS_UPDATE_SITE="http://update.aegis.aliyun.com/download"
AEGIS_INSTALL_DIR="/usr/local/aegis"
install_aegis() {
killall -9 aegis_update
killall -9 aegis_cli
if [ -d ${AEGIS_INSTALL_DIR} ];then
rm -rf ${AEGIS_INSTALL_DIR}
fi
mkdir -p "${AEGIS_INSTALL_DIR}/aegis_client"
mkdir -p "${AEGIS_INSTALL_DIR}/aegis_update"
wget "${AEGIS_UPDATE_SITE}/$ARCH/update_00_06/aegis_update" -O "${AEGIS_INSTALL_DIR}/aegis_update/aegis_update" -T 120
if [ $? != 0 ]; then
echo "wget aegis_update error" 1>&2
exit 1
fi
wget "${AEGIS_UPDATE_SITE}/$ARCH/update_00_06/agx_update.cfg" -O "${AEGIS_INSTALL_DIR}/aegis_update/agx_update.cfg" -T 120
if [ $? != 0 ]; then
echo "wget agx_update.cfg error" 1>&2
exit 1
fi
chmod +x "${AEGIS_INSTALL_DIR}/aegis_update/aegis_update"
echo "aegis_00_19" > ${AEGIS_INSTALL_DIR}/aegis_update/up_cmd.txt
}
install_service(){
wget "${AEGIS_UPDATE_SITE}/aegis" -O /etc/init.d/aegis
if [ $? != 0 ]; then
echo "wget aegis error" 1>&2
exit 1
fi
chmod +x /etc/init.d/aegis
rm -f /etc/rc2.d/S80aegis
rm -f /etc/rc3.d/S80aegis
rm -f /etc/rc4.d/S80aegis
rm -f /etc/rc5.d/S80aegis
ln -s /etc/init.d/aegis /etc/rc2.d/S80aegis >/dev/null 2>&1
ln -s /etc/init.d/aegis /etc/rc3.d/S80aegis >/dev/null 2>&1
ln -s /etc/init.d/aegis /etc/rc4.d/S80aegis >/dev/null 2>&1
ln -s /etc/init.d/aegis /etc/rc5.d/S80aegis >/dev/null 2>&1
}
uninstall_service() {
rm -f /etc/init.d/aegis
rm -f /etc/rc2.d/S80aegis
rm -f /etc/rc3.d/S80aegis
rm -f /etc/rc4.d/S80aegis
rm -f /etc/rc5.d/S80aegis
}
if [ `id -u` -ne "0" ]; then
echo "ERROR: This script must be run as root." 1>&2
exit 1
fi
install_aegis
install_service
service aegis start
echo "Aegis install successful"
exit 0
if [ `uname -m` = "x86_64" ]; then
ARCH="linux64"
else
ARCH="linux32"
fi
AEGIS_UPDATE_SITE="http://update.aegis.aliyun.com/download"
AEGIS_INSTALL_DIR="/usr/local/aegis"
install_aegis() {
killall -9 aegis_update
killall -9 aegis_cli
if [ -d ${AEGIS_INSTALL_DIR} ];then
rm -rf ${AEGIS_INSTALL_DIR}
fi
mkdir -p "${AEGIS_INSTALL_DIR}/aegis_client"
mkdir -p "${AEGIS_INSTALL_DIR}/aegis_update"
wget "${AEGIS_UPDATE_SITE}/$ARCH/update_00_06/aegis_update" -O "${AEGIS_INSTALL_DIR}/aegis_update/aegis_update" -T 120
if [ $? != 0 ]; then
echo "wget aegis_update error" 1>&2
exit 1
fi
wget "${AEGIS_UPDATE_SITE}/$ARCH/update_00_06/agx_update.cfg" -O "${AEGIS_INSTALL_DIR}/aegis_update/agx_update.cfg" -T 120
if [ $? != 0 ]; then
echo "wget agx_update.cfg error" 1>&2
exit 1
fi
chmod +x "${AEGIS_INSTALL_DIR}/aegis_update/aegis_update"
echo "aegis_00_19" > ${AEGIS_INSTALL_DIR}/aegis_update/up_cmd.txt
}
install_service(){
wget "${AEGIS_UPDATE_SITE}/aegis" -O /etc/init.d/aegis
if [ $? != 0 ]; then
echo "wget aegis error" 1>&2
exit 1
fi
chmod +x /etc/init.d/aegis
rm -f /etc/rc2.d/S80aegis
rm -f /etc/rc3.d/S80aegis
rm -f /etc/rc4.d/S80aegis
rm -f /etc/rc5.d/S80aegis
ln -s /etc/init.d/aegis /etc/rc2.d/S80aegis >/dev/null 2>&1
ln -s /etc/init.d/aegis /etc/rc3.d/S80aegis >/dev/null 2>&1
ln -s /etc/init.d/aegis /etc/rc4.d/S80aegis >/dev/null 2>&1
ln -s /etc/init.d/aegis /etc/rc5.d/S80aegis >/dev/null 2>&1
}
uninstall_service() {
rm -f /etc/init.d/aegis
rm -f /etc/rc2.d/S80aegis
rm -f /etc/rc3.d/S80aegis
rm -f /etc/rc4.d/S80aegis
rm -f /etc/rc5.d/S80aegis
}
if [ `id -u` -ne "0" ]; then
echo "ERROR: This script must be run as root." 1>&2
exit 1
fi
install_aegis
install_service
service aegis start
echo "Aegis install successful"
exit 0
0 0
- 阿里云的一个安装脚本
- 一个小型的安装脚本
- linux centos6.5安装redis脚本(阿里的服务器)
- 阿里云服务器zabbix3.0客户端自动安装脚本
- 一个installsheild脚本安装的代码
- 一个阿里云的面试题
- 阿里云的备案很快,赞一个
- 一个产品人和“阿里云”的故事
- 阿里云配置遇到的一个问题
- 阿里云收集服务器性能指标的python脚本
- 阿里云aegis服务脚本
- 一个脚本安装mysql
- 阿里云里的mysql安装
- 阿里云服务器MySql的安装
- 阿里云CentOS pdf2htmlEX的安装
- 阿里云 Linux ContOS Git的安装
- 阿里云CentOS pdf2htmlEX的安装
- CentOS安装阿里云的源
- solr配置多个core
- 阿里云重新自动分区脚本
- 与网络相关的命令
- 黑马程序员----String 内存问题
- on()、live()、bind()、one()的区别
- 阿里云的一个安装脚本
- 基于Qt的Http编程-基本原理 GET方式
- 关机与重启的命令
- linux下快速删除oracle
- Google Guava Collections 使用介绍
- 虚函数与纯虚函数
- ZOL上,下载的这个嵌入版本如何使用
- ndb cluster部署
- 机器学习其实比你想的更简单