How to chkconfig off multiple services with bash.

Filed in Bash

How to chkconfig off multiple services with bash.

IN="atd auditd avahi-daemon avahi-dnsconfd bluetooth clvmd cman conman cpuspeed cups dnsmasq dund gfs gfs2 gpm ip6tables iptables irda irqbalance kdumpkudzu mcstrans mdmonitor mdmpd microcode_ctl netconsole netplugd nscd ntpd oddjobd openais pand pcscd psacct qdiskd rawdevices rdisc readahead_early readahead_later restorecond sendmail setroubleshoot tcsd vncserver wdaemon wpa_supplicant xfs ypbind yum-updatesd"

arr=$(echo $IN | tr " " "\n")
for x in $arr
do
/sbin/chkconfig $x off &>/dev/null || echo -e "\033[1m * Service $x not exists\033[0m"
done

Feedback

Comments

One Response to “How to chkconfig off multiple services with bash.”
  1. Roberta says:

    cool!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please wrap all source codes with [code][/code] tags.