[root@www zabbix_scripts]# cat check_httpd.sh
#!/bin/bash
a=`lsof -i: | wc -l`
if [ "$a" -gt "" ];then
echo ""
else
echo ""
fi

shell脚本判断端口是否打开的更多相关文章

  1. Shell脚本 判断

    #Linux系统Shell脚本判断变量文件目录:权限.是否存在.空值.相等 1.字符串判断 str1 = str2 当两个串有相同内容.长度时为真str1 != str2 当串str1和str2不等时 ...

  2. Linux shell脚本判断服务器网络是否可以上网

    Linux shell脚本判断网络畅通 介绍 在编写shell脚本时,有的功能需要确保服务器网络是可以上网才可以往下执行,那么此时就需要有个函数来判断服务器网络状态 我们可以通过curl来访问 www ...

  3. shell 脚本——判断条件

    在之前的shell语言学习笔记中已经写过shell的几种判断语句及循环语句,也简单的介绍了shell语言判断语句和判断条件.在此再做进一步学习. test命令的测试功能 test命令用于检测系统文件及 ...

  4. Windows server利用批处理脚本判断端口, 启动tomcat

    win server服务器上面的tomcat老是不定时挂掉, 于是利用定时操作脚本判断tomcat80端口是否在运行, 如果运行则放过, 如果down掉就启动tomcat,解决tomcat不定时挂掉导 ...

  5. shell脚本判断语句和循环语句

    if判断语句 exit跳出判读语句 不加exit的结果 read -n(不换行) 判断是否输入的是数字 read age[[ $age =~ ^[0-9]+$ ]]if [ $? -ne 0 ]; t ...

  6. shell脚本判断文件类型

    转自:http://www.cnblogs.com/sunyubo/archive/2011/10/17/2282047.html 1. shell判断文件,目录是否存在或者具有权限 2. #!/bi ...

  7. 【原】Shell脚本-判断文件有无进而复制

    2016年7月5日某同学在群上求助要编一个判断文件或目录在某路径下有无进而有的就复制粘贴到另一路径下,无的则将代码中断(不往下执行命令)的脚本.逐一完善.模板如下(生产环境可用到路径环境变量) --- ...

  8. shell脚本判断安装包位置及类型

    Log() { LogFile=/tmp/``.log LogDate=$(date +"%F %T") echo -e "\n\n||| ${LogDate} ||| ...

  9. shell脚本判断执行用户

    在脚本中,判断执行者是否为root. 判断方法1, #!/bin/bash if [ `whoami` != "root" ];then echo " only root ...

随机推荐

  1. Dell服务器硬件监控,使用omreport出现object not found 错误解决

    一.监控告警 登录目标主机,查看dataeng服务 [root@push-- src]# systemctl status dataeng ● dataeng.service - LSB: Syste ...

  2. C#实现下载Demo

    using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Secu ...

  3. linux系统很卡的基本排查方法

    1. 查看内存使用情况 free -g 当观察到free栏已为0的时候,表示内存基本被吃完了,那就释放内存吧(释放内存参考上篇文章) 2. 查看磁盘使用情况 df -h 当发现磁盘使用率很高时,那就要 ...

  4. 【HDU2204】Eddy's爱好

    题目大意:求从 1 到 N 中共有多少个数可以表示成 \(M^K,K \gt 1\).\(N \le 1e18\) 题解: 发现 N 很大,若直接枚举 M 的话有 1e9 级别的数据量,肯定超时,因此 ...

  5. ELK——集中式日志系统

    https://www.ibm.com/developerworks/cn/opensource/os-cn-elk/index.html 基本流程是 Shipper 负责从各种数据源里采集数据,然后 ...

  6. 【leetcode】1243. Array Transformation

    题目如下: Given an initial array arr, every day you produce a new array using the array of the previous ...

  7. 【BZOJ3944】 Sum

    Description Input 一共T+1行 第1行为数据组数T(T<=10) 第2~T+1行每行一个非负整数N,代表一组询问 Output 一共T行,每行两个用空格分隔的数ans1,ans ...

  8. BatchNormalization、LayerNormalization、InstanceNorm、GroupNorm、SwitchableNorm总结

    https://blog.csdn.net/liuxiao214/article/details/81037416 http://www.dataguru.cn/article-13032-1.htm ...

  9. 小程序踩坑之获取不到e.target.dataset的值

    在页面与js传值中我们经常用到data-id="1"的方式,然后通过e.target.dataset.id取id的值今天在获取值时怎么也取不到,后来发现e对象有currentTar ...

  10. 项目配置 xml文件时 报错提示(The reference to entity "useSSL" must end with the ';' delimiter.)

    这次在配置xml文件时,出现错误提示( The reference to entity “useSSL” must end with the ‘;’ delimiter.) 报错行为 <prop ...