Case of shell Script Automation deployment XX (with array)

Source: Internet
Author: User

#!/bin/sh#auto make install MFS files#cat <<eof++++++++++++++++welcome to use Auto install MFS Scripts +++++++++++++ ++++++++++++++++++++++++++this MFS Install Version 1.6.27+++++++++++++++++++++++++++++++++++++++++++++++2013-12-04 Author wugk ++++++++++++++++++++++++++eof#defined variablessrc_dir=/usr/src/mfs_count= (http://www.moosefs.org/tl_ files/mfscodemfs-1.6.27-1.tar.gzmfs-1.6.27 "./configure--prefix=/usr--sysconfdir=/etc--localstatedir=/var/lib --with-default-user=mfs--with-default-group=mfs--disable-mfschunkserver--disable-mfsmount ""./configure-- PREFIX=/USR--sysconfdir=/etc--localstatedir=/var/lib--with-default-user=mfs--with-default-group=mfs-- Disable-mfsmaster ""./configure--prefix=/usr--sysconfdir=/etc--localstatedir=/var/lib--with-default-user= MFS--with-default-group=mfs--disable-mfsmaster--disable-mfschunkserver ") # #Defined Function Command Master MFS Installmaster_mfs () {if [-e/usr/sbin/mfsmaster];thenecho "This mfsmaster already exists,Please exit "Exit 0fi#download MFS SOft Version 1.6.27cd $SRC _dir; Wget-c ${mfs_count[0]}/${mfs_count[1]} &&echo "Download ${mfs_count[1]} successfully!" #Configure MFS and make install and configuration MFS Groupadd MFS; USERADD-G MFS MFSTAR-XZF ${mfs_count[1]}; CD ${mfs_c OUNT[2]} &&${mfs_count[3]} &&make &&make install[$? = = 0]&&echo "This MFS ${MFS_COUNT[2 ]} Install successfully,please Wait Config master_mfs ... "cd/etc/mfs/&AMP;&AMP;CP mfsmaster.cfg.dist MFSMASTER.CFGCP mfsmetalogger.cfg.dist MFSMETALOGGER.CFGCP mfsexports.cfg.dist Mfsexports.cfgcd/var/lib/mfs; MV Metadata.mfs.empty metadata.mfs}# #Defined Function Command Chunks MFS Installchunks_mfs () {if [-e/usr/sbin/        Mfschunkserver];thenecho "This mfschunkserver already exists,please exit" Exit 0fi#download MFS SOft Version 1.6.27 CD $SRC _dir; Wget-c ${mfs_count[0]}/${mfs_count[1]} &&echo "Download ${mfs_count[1]} successfully!" #Configure MFS and make install and configuration MFS Groupadd MFS; USERADD-G MFS MFS TAR-XZF ${mfs_count[1]}; CD ${mfs_count[2]} && AMP;${MFS_COUNT[4]} &&make &&make Install [$ = = 0]&&echo "This MFS ${mfs_count[2]} Insta ll successfully,please Wait Config Chunk_mfs ... "cd/etc/mfs/&AMP;&AMP;CP mfschunkserver.cfg.dist MFSCHUNKSERVER.CFGCP mfshdd.cfg.dist mfshdd.cfgmkdir-p/data/{mfs1,mfs2}echo-e "/DATA/MFS1\N/DATA/MFS2" >>  Mfshdd.cfgchown-r mfs:mfs/data/mfs1chown-r Mfs:mfs/data/mfs2}client_mfs () {if [-e/usr/bin/mfsmount];then echo ' This Mfschunkserver already exists,please exit "Exit 0fi#download MFS SOft Version 1.6.27 cd $SRC _dir; Wget-c ${mfs_count[0]}/${mfs_count[1]} &&echo "Download ${mfs_count[1]} successfully!"         #Configure MFS and make install and configuration MFS Groupadd MFS; useradd-g MFS Mfsyum Install fuse-devel-y Tar-xzf ${mfs_count[1]}; CD ${mfs_count[2]} &&${mfs_count[5]} &&make &Amp;&make Install [$ = = 0]&&echo-e "This MFS ${mfs_count[2]} Client install successfully\nyou Can U SE: {/usr/bin/mfsmount/mnt/-H mfs_master_ip} to Mount! "} Case $ in Master_mfs) Master_mfs;; CHUNKS_MFS) Chunks_mfs;; CLIENT_MFS) Client_mfs;; *) Echoecho "$ {MASTER_MFS | Chunks_mfs | Client_mfs} ";; Esac

  

Case of shell Script Automation deployment XX (with array)

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.