全球主机交流论坛

标题: A2系统自带的shell不错分享下哈哈 [打印本页]

作者: chaoren521    时间: 2012-2-9 11:02
标题: A2系统自带的shell不错分享下哈哈
  1. #!/bin/bash -
  2. #===============================================================================
  3. #
  4. #          FILE:  quickinstall.sh
  5. #
  6. #         USAGE:  ./quickinstall.sh
  7. #
  8. #   DESCRIPTION:  Quick Installation of Applications
  9. #
  10. #        AUTHOR: Mark J.
  11. #       COMPANY: A2 Hosting
  12. #       CREATED: 08/04/2011 15:45:46 PM EDT
  13. #      REVISION:  2
  14. #===============================================================================

  15. #set -o nounset                              # Treat unset variables as an error

  16. # Define variables

  17. #Determine OS and menu to provide
  18. echo "Verifying latest menu, please wait..."
  19. if [ -f /etc/redhat-release ];
  20. then
  21.         OS=`cat /etc/redhat-release | awk '{print $1}'`
  22.         if [ $OS = CentOS ]
  23.                 then
  24.                         OSV=`cat /etc/redhat-release | awk '{print $3}' | cut -d "." -f1`
  25.                         if [ $OSV = 5 ]
  26.                                 then
  27.                                         wget -qO /usr/src/menu.sh http://vpsrepo.a2hosting.com/semi/CENTOS5
  28.                                         sh /usr/src/menu.sh
  29.                                 else
  30.                                         wget -qO /usr/src/menu.sh http://vpsrepo.a2hosting.com/semi/CENTOS6
  31.                                         sh /usr/src/menu.sh
  32.                         fi
  33.         elif [ $OS = Fedora ]
  34.                 then
  35.                         OSV=`cat /etc/redhat-release | awk '{print $3}'`
  36.                         if [ $OSV = 12 ]
  37.                                 then
  38.                                         wget -qO /usr/src/menu.sh http://vpsrepo.a2hosting.com/semi/FEDORA12
  39.                                         sh /usr/src/menu.sh
  40.                         elif [ $OSV = 13 ]
  41.                                 then
  42.                                         wget -qO /usr/src/menu.sh http://vpsrepo.a2hosting.com/semi/FEDORA13
  43.                                         sh /usr/src/menu.sh
  44.                         elif [ $OSV = 14 ]
  45.                                 then
  46.                                         wget -qO /usr/src/menu.sh http://vpsrepo.a2hosting.com/semi/FEDORA14
  47.                                         sh /usr/src/menu.sh
  48.                         else
  49.                                         wget -qO /usr/src/menu.sh http://vpsrepo.a2hosting.com/semi/FEDORA15
  50.                                         sh /usr/src/menu.sh
  51.                         fi
  52.         fi       
  53. elif [ -f /etc/lsb-release ];
  54.         then [ OS='Ubuntu' ]
  55.                 OSV=`cat /etc/lsb-release | grep DISTRIB_RELEASE | awk '{print $1}' | cut -d "=" -f2`
  56.                 if [ $OSV = 10.04 ]
  57.                         then
  58.                                 apt-get -qq install wget   > /dev/null 2>&1
  59.                                 wget -qO /usr/src/menu.sh http://vpsrepo.a2hosting.com/semi/UBUNTU104
  60.                                 sh /usr/src/menu.sh
  61.                 elif [ $OSV = 11.04 ]
  62.                         then
  63.                                 apt-get -qq install wget   > /dev/null 2>&1
  64.                                 wget -qO /usr/src/menu.sh http://vpsrepo.a2hosting.com/semi/UBUNTU1104
  65.                                 sh /usr/src/menu.sh
  66.                 else
  67.                         apt-get -qq install wget   > /dev/null 2>&1
  68.                         wget -qO /usr/src/menu.sh http://vpsrepo.a2hosting.com/semi/UBUNTU1110
  69.                         sh /usr/src/menu.sh
  70.                 fi
  71. elif [ -f /etc/debian_version ];
  72. then
  73.         OS='Debian'
  74.         OSV=`cat /etc/debian_version | cut -d "." -f1`
  75.                 if [ $OSV = 5 ]  > /dev/null 2>&1
  76.                         then
  77.                         wget -qO /usr/src/menu.sh http://vpsrepo.a2hosting.com/semi/DEBIAN5
  78.                         sh /usr/src/menu.sh
  79.                 else
  80.                         wget -qO /usr/src/menu.sh http://vpsrepo.a2hosting.com/semi/DEBIAN6
  81.                         sh /usr/src/menu.sh
  82.                 fi
  83. elif [ -f /etc/gentoo-release ];
  84. then
  85.         OS='Gentoo'
  86.         wget -qO /usr/src/menu.sh http://vpsrepo.a2hosting.com/semi/GENTOO2011
  87.         sh /usr/src/menu.sh
  88. else OS='Slackware'
  89.         OSV=`cat /etc/slackware-version | awk '{print $2}' | cut -d "." -f1`
  90.         if [ $OSV = 12 ]
  91.                 then
  92.                         wget -qO /usr/src/menu.sh http://vpsrepo.a2hosting.com/semi/SLACKWARE12
  93.                         sh /usr/src/menu.sh
  94.                 else
  95.                         wget -qO /usr/src/menu.sh http://vpsrepo.a2hosting.com/semi/SLACKWARE13
  96.                         sh /usr/src/menu.sh
  97.         fi
  98. fi
复制代码

作者: Mr.Ra1n    时间: 2012-2-9 11:05
本帖最后由 Mr.Ra1n 于 2012-2-9 11:05 编辑

看不懂看不懂。。
其实我真的不知道这脚本干嘛用的。。。
作者: 用户名    时间: 2012-2-9 11:09
哦耶
作者: 一手好湿    时间: 2012-2-9 11:26
干嘛用的?
作者: bearqq    时间: 2012-2-9 11:30
http://vpsrepo.a2hosting.com/semi/DEBIAN6
看看就知道干嘛用的了
作者: chaoren521    时间: 2012-2-9 11:35
哈哈
作者: lazyzhu    时间: 2012-2-9 11:38
本帖最后由 lazyzhu 于 2012-2-9 11:39 编辑

楼主,你的是最新的?
作者: lazyzhu    时间: 2012-2-9 11:38
最新的是 /usr/sbin/quickinstaller.sh
有选项 9的, 可以安装openvpn的

作者: cquyf    时间: 2012-2-9 11:40
不知道干啥
作者: acalbert    时间: 2012-2-9 11:42
标记~~~~~
作者: 百度    时间: 2012-2-9 11:42
安装程序的啊
作者: sunsea    时间: 2012-2-9 11:48
对啊,这个是做什么用的...
看代码好累的说啊
作者: chaoren521    时间: 2012-2-9 12:52
找个vps测试一下就知道了
作者: 有个就好    时间: 2012-2-9 13:18
确实不错
作者: 零维    时间: 2012-2-9 13:53
收藏+1
作者: 用户名    时间: 2012-2-9 14:01
lazyzhu 发表于 2012-2-9 11:38  最新的是 /usr/sbin/quickinstaller.sh  有选项 9的, 可以安装openvpn的

求最新




欢迎光临 全球主机交流论坛 (https://loc.010206.xyz/) Powered by Discuz! X3.4