diff --git a/files/cli-shutdown.groovy b/files/cli-shutdown.groovy index 719df7f..bac0c0e 100644 --- a/files/cli-shutdown.groovy +++ b/files/cli-shutdown.groovy @@ -30,6 +30,7 @@ THE SOFTWARE. import jenkins.*; import jenkins.model.*; +import hudson.model.*; // disabled CLI access over TCP listener (separate port) def p = AgentProtocol.all() @@ -38,5 +39,9 @@ p.each { x -> } // disable CLI access over /cli URL +def removal = { lst -> + lst.each { x -> if (x.getClass().name.contains("CLIAction")) lst.remove(x) } +} def j = Jenkins.instance; -j.actions.each { x -> if (x.getClass().name.contains("CLIAction")) j.actions.remove(x) } +removal(j.getExtensionList(RootAction.class)) +removal(j.actions)