Shell Script Write Journal--one-click Install EDM Server script grooming (i.)

Source: Internet
Author: User

Note that this article does not involve too many configuration problems, the younger brother just to install the EDM server example to write Shellscript scripting aspects.

In fact, the forum has been registered nearly 4 years, has not been good to write a blog post, one of the blame himself too lazy, and his writing is also poor, do not know what to write something good.

The purpose of writing this article is to want to communicate with more people through the platform of the blog, can meet more friends, think now their vision and circle is really too small too small. And I hope that someday I look back to this article, there will be better ideas, will feel that they are indeed improving, so this article positioning as a diary.

It's hard to start with everything. There's always a way.


Recently there is a need to do the EDM service one-click installation, and most of the installation script has been written in the early morning, only need to integrate it.


1. Say the script runtime environment:

Operating system: CentOS release 6.6 (Final)

View System version commands (for Redhat and CentOS): Cat/etc/redhat-release


2. Talk about the software and services you need to install:

AMH: A set of Lnmp/nginx virtual host panels. The 4.2 version is used. Address: http://amh.sh/install.htm

Pmta: Full name Powermta, an SMTP software for distributing mail.

Address: http://www.port25.com/powermta/evaluate-now/

OME: Full name Oempro, an email marketing tool. Address: http://octeth.com/

S3cmd: A command-line tool that operates on Amazon S3. Address: Https://github.com/s3tools/s3cmd

Postfix: An MTA (mail transfer agent) software.


3. Talk about Mind Mapping:

At first I wrote a mind map with Xmind. Mind map also did not write a lot of content, always think the mind map should be as simple as possible better. Of course, this script is also very simple, no problem involving too much logic, naturally looks more simple.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/53/D4/wKioL1Rx3MiQ2L_8AAEFS_o3KnQ258.jpg "title=" edm_ Server_install.png "alt=" Wkiol1rx3miq2l_8aaefs_o3knq258.jpg "/>


4. Say the naming method:

Function name: uppercase and lowercase, each word with the first letter capitalized. For example AMH install I write function Amhinstall.

Constant Name: Uppercase + underline, separated by underscores before each word. For example, the database root password constant I write

Mysql_root_password

Variable name: lowercase + underline.


Brother temporarily or try to write the name of the whole, without shorthand. Although the code will look bloated, it's easy to see for yourself.


5. Say the beginning of the script:

#!/bin/bash # Created by Clark 2014.11.22# Contact email: [Email protected]# name:oem_pmta_instal l.sh# This script was used to install OEM + pmta# Version 2.0# 1. AMH install# 2. Pmta install# 3. OEM install# 4. S3cmd install# 5. Postfix install# 6. Cronjob config# 7. Backup Config

Usually the script starts with the exception of the default parser declaration: #!/bin/bash, I will add the date of writing, contact, script name, script purpose, script version and so on.

But script version control I haven't been working on it. You should record the features that each version modifies and adds.


In fact, the entire script has been written to be able to use, is not perfect, while writing this article when there are some new ideas, and then turn around to change the script. Write so much for the time being, go ahead tomorrow.



This article is from "Roll it!" Ah marina, please make sure to keep this source http://clarklin1989.blog.51cto.com/1165777/1581721

Shell Script Write Journal--one-click Install EDM Server script grooming (i.)

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.