#!/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
filinux shell脚本,检测 服务是否启动,如果启动,将其关闭
最新推荐文章于 2024-09-26 13:42:39 发布
本文介绍了一个简单的bash脚本,该脚本用于检查并禁用Linux系统中的特定服务(如auditd和autofs),适用于系统管理员进行服务管理操作。
313

被折叠的 条评论
为什么被折叠?



