Bash Script Programming sixteen automatic deployment of NFS server

Source: Internet
Author: User

Create the NFS/server directory. This script automatically installs and configures the NFS server.

Install. Sh script:

#! /Bin/bash source.../common/tool. shnfs = "nfs-kernel-server" hasdpkg $ nfsr =$? If [$ R-EQ 1] Then ECHO "$ NFS was installed" else echo "$ NFS was not installed" apt-Get install $ nfsfiif [-d "/opt/share"] Then ECHO "/opt/share" exists alreadyelse mkdir-P/opt/share chmod-r 777/opt/sharefi # config/opt/share as NFS foldermv/etc/exports/ ETC/exports_bkmv/etc/hosts. deny/etc/hosts. deny_bkmv/etc/hosts. allow/etc/hosts. allow_bkcp exports/etc/CP hosts. deny/etc/CP hosts. allow/etc/service Portmap restartservice nfs-kernel-server restart

The exports, hosts. deny, and hosts. allow files have been prepared in the current directory.

Refer to the previous blog: http://blog.csdn.net/sheismylife/article/details/7987638

The IP address should be modified according to the specific deployment environment.

The hasdpkg function previously developed is reused here.

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.