WDCP Environment Build shell script analysis--install.sh

Source: Internet
Author: User

#!/bin/bash### #定义screen的名字, the following installation will use screen this command screen_name= "LANMP" #根据 $UID to determine whether the user is root, must root to perform if [  $UID  != 0 ]; then    echo  "You must be root to  run the install script. "     exitfi# according to the command line parameters, the parameter is un or uninstall, stop the service, delete the file, uninstall the entire WDCP service if [  "$"  ==   "UN"  -o  "$"  ==  "Uninstall"  ]; then    service  httpd stop    service nginxd stop    service  mysqld stop    service pureftpd stop    service  wdapache stop     #建立文件备份目录     mkdir /www/backup     bf=$ (date +%y%m%d)      #打包数据库文件     tar zcf / Www/backup/mysqlbk_$bf.tar.gz /www/wdlinux/mysql/var    rm -fr /www/wdlinux    rm -f /tmp/*_ins.txt    reboot     exitfi# determines whether the screen process exists in the current system, prompts if a lanmp screen process already exists, and exits If type -p screen  >/dev/null && screen -ls |grep -q  "[0-9]. $SCREEN _name";  then    echo  "seems another lanmp install session is  Taken place. "     echo  "rejoin this session plz type:  ' Screen -r   $SCREEN _name '. "     exit 1fi# determines the current system type based on/etc/issue and then, based on the return result of type, determines if screen is installed and installs without installation If grep  -qi  ' Debian\|ubuntu '  /etc/issue; then    type -p screen  >/dev/null | |  apt-get -y install screenelse    type -p screen >/ dev/null | |  yum -y install screenfi


This article from the "Practice is true truth" blog, declined reprint!

WDCP Environment Build shell script analysis--install.sh

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.