Skip to content

Instantly share code, notes, and snippets.

@jlgreer
Created April 15, 2011 15:36
Show Gist options
  • Save jlgreer/921894 to your computer and use it in GitHub Desktop.
Save jlgreer/921894 to your computer and use it in GitHub Desktop.
bundle agent chkconfig_on(foo) {
classes:
"service_is_enabled" expression => returnszero("/usr/bin/chkconfig --level 3 $(foo)");
commands:
!service_is_enabled::
"/sbin/chkconfig $(foo) on";
}
bundle agent chkconfig_off(foo) {
classes:
"service_is_enabled" expression => returnszero("/usr/bin/chkconfig --level 3 $(foo)");
commands:
service_is_enabled::
"/sbin/chkconfig $(foo) off";
}
bundle agent chkconfig_add(foo) {
classes:
"service_is_in_chkconfig" expression => returnszero("/usr/bin/chkconfig --list $(foo)");
commands:
!service_is_in_chkconfig::
"/sbin/chkconfig --add $(foo)";
}
bundle agent chkconfig_del(foo) {
classes:
"service_is_in_chkconfig" expression => returnszero("/usr/bin/chkconfig --list $(foo)");
commands:
service_is_in_chkconfig::
"/sbin/chkconfig --del $(foo)";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment