Skip to content

Instantly share code, notes, and snippets.

@t9md
Created December 18, 2010 13:15
Show Gist options
  • Save t9md/746493 to your computer and use it in GitHub Desktop.
Save t9md/746493 to your computer and use it in GitHub Desktop.
#!/bin/bash
export LANG=C
for service in $(/sbin/chkconfig --list | grep 3:on | awk '{ print $1 }')
do
while :
do
echo -n "disable $service ?: "
read answer
case $answer in
Y|y)
break
;;
i|I)
initscript=/etc/init.d/$service
if [ -f $initscript ]; then
rpm -qi $(rpm -qf $initscript)
fi
;;
*)
;;
esac
done
/sbin/chkconfig $service off
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment