Shell

Ftp 一键安装shell脚本

#!/bin/bash # Author: Ropon # Blog: https://www.ropon.top InstallFtp() { pushd $BaseDir # 批量下载并解压所需包 for key in ${!FtpFiles[*]}; do [ ! -f ${FtpFiles[$key]}.tar.gz ] && Dow...

shell 变量

# 定义普通变量 只能由字母、数字、下划线组成,只能以字母或下划线开头 web_path=/home/wwwroot web_path='/home/wwwroot' web_path="/home/wwwroot" web_path=$(pwd) # 命令执行结果赋给变量 # awk输出 ...

Centos批量绑定IPV6地址

#!/bin/bash # Author: Ropon # Blog: https://www.ropon.top eth0f="/etc/sysconfig/network-scripts/ifcfg-eth0" resf="/etc/resolv.conf" ipv6="" ipgw="" restartflag=0 Help() { echo "Usage: ./$(basen...

初识shell

#!/bin/bash # 脚本第一行指定那个解释器来执行 # Date: # Author: # Blog: # Description: # Version: #查看默认shell echo $SHELL grep root /etc/passwd #增加vi别名 alias vi='vim' echo "alias vi=...

Mysql 一键安装shell脚本

#!/bin/bash # Author: Ropon # Blog: https://www.ropon.top RunUser=mysql InstallMysql() { pushd $BaseDir [ "${MysqlVer}" == "5.7.25" ] && MysqlModulesOptions="-DWITH_BOOST=boost" #if [ ...

Php 一键安装shell脚本

#!/bin/bash # Author: Ropon # Blog: https://www.ropon.top InstallPhp() { pushd $BaseDir # 批量检测并创建所需目录 for key in ${!PhpDirs[*]};do [ ! -d "${PhpDirs[$key]}" ] && mkdir -p ...

Centos7.x 一键优化shell脚本

#!/bin/bash # Author: Ropon # Blog: https://www.ropon.top LANG=en_US.UTF-8 Mem=`free -m | awk '/Mem:/{print $2}'` Swap=`free -m | awk '/Swap:/{print $2}'` InitBase() { # 检查是否有wget命令 whic...

Nginx 一键安装shell脚本

#!/bin/bash # Author: Ropon # Blog: https://www.ropon.top InstallNginx() { pushd $BaseDir # 批量下载并解压所需包 for key in ${!NgFiles[*]}; do [ ! -f ${NgFiles[$key]}.tar.gz ] && Dow...

Shell 简单判断系统类型

#!/bin/bash if [ -e /etc/redhat-release ]; then OS=CentOS [ -n "$(grep ' 7\.' /etc/redhat-release 2> /dev/null)" ] && OS_Ver=7 [ -n "$(grep ' 6\.' /etc/redhat-release 2> /dev/n...