Chinaunix首页 | 论坛 | 博客
  • 博客访问: 310033
  • 博文数量: 42
  • 博客积分: 2718
  • 博客等级: 少校
  • 技术积分: 467
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-19 10:23
个人简介

青 田 酒 店 服 务 小 姐 价 格 186-6531-7773

文章分类

全部博文(42)

文章存档

2011年(36)

2010年(6)

分类: LINUX

2011-03-20 13:56:46

方法说明:

1)更新安装包:
直接运行update.sh即可:
sh update.sh
2)解锁IP地址访问限制:
比如你的IP地址为192.168.1.100,访问
时提示访问受限,则运行allow_ip.sh可以解锁。
chmod 777 allow_ip.sh
./allow_ip.sh 192.168.1.100 
即可解开对192.168.1.100的访问限制
更新步骤:
1:更新安装包
2:重启机器
3:解锁IP访问
修改内容:
更新了windows安装包
解决了控制中心后台程序的几个缺陷
更新了web程序的几个缺陷
给后台程序增加了版本信息
整理数据库表内容,清理了安装时不需要的数据,只保留了初始化数

#==============================allow_ip.sh-============================
  1. if [ $# -ne 1 ]
  2. then
  3.     echo "usage:$0 ip addr"
  4.     exit 1
  5. fi
  6. echo $1

  7. echo "mysql -uroot -pcmemysql -e \"use cme; update t_limited_addr set limit_flag = -1 where ip='$1'\"" > tmp.sh
  8. sh tmp.sh
  9. rm -fr tmp.sh
  10. ipaddr=`ifconfig eth0 | grep "inet addr" | awk '{print$2}' | awk -F ':' '{print$2}'`
  11. echo "please now goto site:"

=====================自启动脚本cmeserverd==============================
  1. ###########################------cucme------------------------
  2. #!/bin/sh
  3. #
  4. # cme server
  5. #
  6. # chkconfig: 2345 99 12
  7. # description: cme server service autorun scripts by cme@2010-05-17
  8. ./etc/rc.d/init.d/functions
  9. update_ipaddr ()
  10. {
  11.     addr=`ifconfig eth0 | grep "inet addr" | awk '{print $2}' | awk -F ':' '{print$2}'`
  12.     pass=`cat /usr/local/cme/web/cme/cme_conf.php | grep cme_pass | awk -F "=" '{print$2}' | awk -F ';' '{print$1}' | awk -F '"' '{print$2}'`
  13.     user=`cat /usr/local/cme/web/cme/cme_conf.php | grep cme_user | awk -F "=" '{print$2}' | awk -F ';' '{print$1}' | awk -F '"' '{print$2}'`
  14.     strSQL1="\"update t_hostinfo set HostIP='$addr' where type = 2;\""
  15.     strSQL2="\"update t_host_top set parent_ip = '$addr', host_ip = '$addr' where host_level = 1;\""
  16.     strSQL3="\" update t_host_top set parent_ip = '$addr' where host_level = 2;\""
  17.     strSQL4="\" update t_sysvar set VarValue = '$addr' where p_VarID = 15;\""
  18.     echo "/usr/local/cme/mysql/bin/mysql -u${user} -p${pass} cme -e ${strSQL1}" > /tmp/1.sh
  19.     echo "/usr/local/cme/mysql/bin/mysql -u${user} -p${pass} cme -e ${strSQL2}" >> /tmp/1.sh
  20.     echo "/usr/local/cme/mysql/bin/mysql -u${user} -p${pass} cme -e ${strSQL3}" >> /tmp/1.sh
  21.     echo "/usr/local/cme/mysql/bin/mysql -u${user} -p${pass} cme -e ${strSQL4}" >> /tmp/1.sh
  22.     sh /tmp/1.sh
  23.     rm -f /tmp/1.sh
  24. }
  25. start_task()
  26. {
  27.     name=$1
  28.     path=$2
  29.     #echo "name=$name,path=$path"
  30.     num=`ps -A | grep -w $name | wc -l`
  31.     if [ $num = 0 ]
  32.     then
  33.         $path &
  34.     else
  35.         echo "$name already running"
  36.     fi
  37. }

  38. stop_task()
  39. {
  40.     name=$1
  41.     num=`ps -A | grep -w $name | wc -l`
  42.     if [ $num = 0 ]
  43.     then
  44.         echo "$name is not running"
  45.     else
  46.         killall -9 $name
  47.         num1=`ps -A | grep -w $name | wc -l`
  48.         if [ $num1 = 0 ]
  49.          then
  50.             echo "$name is killed"        
  51.         else
  52.             echo "stop '$name' failed"
  53.         fi
  54.     fi

  55. }


  56. start()
  57. {
  58.   while true
  59.   do
  60.       ps -A | grep -w mysqld | awk '{if(NR == 1)print $1}' | xargs test
  61.       if [ $? = 0 ];
  62.          then
  63.         update_ipaddr;
  64.                   cd /usr/local/cme/cpp/bin/
  65.         start_task cmdserver ./cmdserver
  66.         #./cmdserver &
  67.         start_task dbserver ./dbserver
  68.         #./dbserver &
  69.         start_task msgserver ./msgserver
  70.         #./msgserver &
  71.         cd cmeAgent/
  72.         #./cmeAgent&
  73.         cd /usr/local/cme/cpp/bin/
  74.          break;
  75.          else
  76.                sleep 1
  77.          fi
  78.   done
  79. }

  80.  

  81. stop()
  82. {
  83.    #killall cmdserver dbserver msgserver cmeAgent >/dev/null 2>&1
  84.        stop_task cmdserver
  85.     stop_task dbserver
  86.     stop_task msgserver
  87.     stop_task cmeAgent
  88.     #killall cmdServer dbta_server msgserver >/dev/null 2>&1
  89. }
  90. . /etc/rc.d/init.d/functions

  91. case "$1" in
  92.         start)
  93.                 start &
  94.                 ;;
  95.         stop)
  96.                 stop
  97.                 ;;
  98.           *)
  99.                 echo "cmeserverd start | stop "
  100.                 ;;
  101.      esac
阅读(2243) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

send_linux2013-05-13 15:10:13

文明上网,理性发言...