#!/bin/bash
name="3:启用"
service1=$(echo `chkconfig --list auditd`|sed 's:\s:/:g'|cut -d / -f 5)
service2=$(echo `chkconfig --list autofs`|sed 's:\s:/:g'|cut -d / -f 5)
if [ $name == $service1 ];then
chkconfig --level 345 auditd off
fi
if [ $name == $service2 ];then
chkconfig --level 345 autofs off
fi
linux shell脚本,检测 服务是否启动,如果启动,将其关闭
最新推荐文章于 2024-09-26 13:42:39 发布