#!groovy

import jenkins.model.*
import hudson.security.*

def instance = Jenkins.getInstance()

println "--> creating local user 'admin'"

def hudsonRealm = new HudsonPrivateSecurityRealm(false)
hudsonRealm.createAccount('admin','admin')
instance.setSecurityRealm(hudsonRealm)

def strategy = new FullControlOnceLoggedInAuthorizationStrategy()
instance.setAuthorizationStrategy(strategy)
instance.save()
#!groovy

import jenkins.model.*
import hudson.security.*

println "--> creating local user 'admin'"

def instance = Jenkins.getInstance()
def hudsonRealm = new HudsonPrivateSecurityRealm(false)
def strategy = new FullControlOnceLoggedInAuthorizationStrategy()

hudsonRealm.createAccount('admin','admin')
instance.setSecurityRealm(hudsonRealm)
instance.setAuthorizationStrategy(strategy)
instance.save()

println "--> delete this script file"

def scriptFile = new File(getClass().protectionDomain.codeSource.location.path)
scriptFile.delete()
Fix for not overwriting the config.xml if Jenkins is restarted
Fix for not overwriting the config.xml if Jenkins is restarted
