![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
脚本
༺哈哈༻
这个作者很懒,什么都没留下…
展开
-
tomcat启动脚本
#!/bin/bash# Tomcat init script for Linux# chkconfig: 2345 96 14# discription: The Apache Tomcat Server/JSP containerJAVA_HOME=/usr/local/jdk1.8.0_171/CATALINA_HOME=/usr/local/tomcatstart_tomcat=$CATALINA_HOME/bin/startup.sh #tomcat启动文件stop_to原创 2021-05-05 15:09:26 · 410 阅读 · 0 评论 -
nginx日志切割脚本
nginx安装路径/usr/local/nginx#!/bin/bashTIME=`date +%F -d -1day`cd /usr/local/nginx/logsif [ ! -d cut ];then mkdir cutfimv access.log cut/access_$TIME.logmv error.log cut/error_$TIME.log/usr/local/nginx/sbin/nginx -s reloadcd /usr/local/nginx/logs/cu原创 2021-05-04 14:00:08 · 122 阅读 · 0 评论 -
nginx启动脚本
#!/bin/bash# chkconfig: 2345 99 20# description: Nginx Service Control ScriptPROG="/usr/local/nginx/sbin/nginx"PIDF="/usr/local/nginx/logs/nginx.pid"check_port_pid(){ netstat -anput | grep ":80" &>/dev/null && pgrep nginx &>/de原创 2021-04-17 09:50:12 · 343 阅读 · 0 评论 -
查看系统运行状态脚本
绿色脚本[root@haha ~]# cat tools.sh #!/bin/bashmenu(){cat<<eof+++++++系统管理工具箱++++++++ h 显示命令帮助 f 显示磁盘分区 d 显示磁盘挂载 m 查看内存使用 u 产看系统负载 q 退出程序+++++++++++++++++++++++++++++eof}fdisk(){ df -hT}diskinfo(){ df -hT | awk '/^\/dev/{print $1"\t\t原创 2021-03-07 11:40:12 · 253 阅读 · 0 评论 -
实时同步时自动检查sersync服务运行状态
在实时同步时为了防止sersync服务挂掉可以写一个开启sersync服务的脚本将脚本写入计划任务中[root@haha ~]# vim autostart-sersync.sh#!/bin/bashsersync="/opt/sersync/sersync2"confxml="/opt/sersync/confxml.xml"status=`ps aux | grep 'sersync2' | grep -v 'grep' | wc -l`if [ $status -eq 0 ];th原创 2021-01-28 13:20:53 · 267 阅读 · 1 评论 -
DHCP服务效率脚本
绿色脚本#!/bin/bashCONFIG=/etc/dhcp/dhcpd.confCONFIG_option="subnet 192.168.${1}.0 netmask 255.255.255.0 {range 192.168.${1}.${2} 192.168.${1}.${2};option routers 192.168.${1}.1;option broadcast-address 192.168.${1}.254;default-lease-time 600;max-leas原创 2021-01-21 22:06:45 · 260 阅读 · 0 评论 -
apache安装脚本
绿色脚本#!/bin/bashapache=httpd-2.4.41.tar.gzpath=/usr/local/httpdconfig="--prefix=$path --enable-so --enable-rewrite --enable-charset-lite --enable-cgi"rpm -e httpd --nodeps &>/dev/nullyum -y install gcc* apr* pcre* cyrus-sasl-devel expat-dev原创 2021-01-15 15:44:04 · 3169 阅读 · 3 评论 -
MySQL安装脚本
绿色脚本#!/bin/bashpackage=mysql-community-5.7.26-1.el7.src.rpmboost=boost_1_59_0.tar.bz2MY=mysql-5.7.26.tar.gzconfig="-DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql/data -DSYSCONFDIR=/etc -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBA原创 2021-01-12 00:13:28 · 273 阅读 · 2 评论 -
shell中的test测试命令
test的定义Shell中的 test 命令用于检查某个条件是否成立,它可以进行数值、字符和文件三个方面的测试格式test 测试条件 或 [ 测试条件 ]注意事项:中括号两边要有空格test和[ ]用哪个都是一样效果测试条件整数比较-eq 等于(equal) [ $a -eq $b ]-ne 不等于(not equal) [ $a -ne $b ]-gt 大于(greater than) [ $a -gt $b原创 2021-01-07 17:32:06 · 692 阅读 · 0 评论 -
shell脚本中的函数
函数的定义变量是被我们赋予一个值来使用,函数就像一个快捷键一样,当我们定义函数后,只要引用其对应的函数名,就可以使用我们设置好的功能函数的创建和使用代码如下:#!/bin/bashfunction functionname(){ ##function可以不写,functionname 是这个函数的名字,使用时就是引用这个名字 echo "haha" echo "heihei" echo "hello"}##函数定义格式 function functionname(原创 2021-01-06 18:02:23 · 100 阅读 · 0 评论 -
shell脚本中cat << eof ,出现错误输出
shell脚本中cat << eof ,出现错误输出首先,我们先看下正常的输出;// An highlighted blockcat test.sh#!/bin/bashcat << eof*******************test eof*******************eof// An highlighted blocksh test.sh*******************test eof*******************正常的使原创 2021-01-04 22:20:11 · 1125 阅读 · 0 评论