Skip to content

Instantly share code, notes, and snippets.

@bndabbs
bndabbs / disable_repos.sh
Created April 4, 2016 13:54
disable all yum repos
repos=$(yum -v repolist |grep Repo-id |awk '{print $3}'|awk -F/ '{print $1}')
for i in "${repos[@]}"; do yum-config-manager --disable $i; done
@bndabbs
bndabbs / AddKolaRepos.sh
Last active March 2, 2016 16:08
Create Kolla Docker Repos
for i in "centos-rdo-keystone" "centos-rdo-base" "centos-rdo-glance-base" "centos-rdo-horizon" "centos-rdo-mariadb-app" "centos-rdo-neutron-base" "centos-rdo-nova-base" "centos-rdo-nova-compute" "centos-rdo-nova-libvirt" "centos-rdo-nova-network" "centos-rdo-rabbitmq" "fedora-rdo-base" "fedora-rdo-glance-api" "fedora-rdo-glance-registry" "fedora-rdo-keystone" "fedora-rdo-mariadb" "fedora-rdo-nova-api" "fedora-rdo-nova-base" "fedora-rdo-nova-compute" "fedora-rdo-nova-conductor" "fedora-rdo-nova-libvirt" "fedora-rdo-nova-network" "fedora-rdo-nova-scheduler" "fedora-rdo-rabbitmq" "fedora-rdo-zaqar";
do hammer -u brad -p sanitized repository create --content-type "docker" --docker-upstream-name kollaglue/$i --name $i --label $i --product Kolla --url https://registry.hub.docker.com --organization "Default Organization";
done
Function CheckProcess
{
$Service = $(Get-Service -ComputerName $Computer -Name $ServiceName -ErrorAction SilentlyContinue)
IF ($Service -eq $null)
{Write-Host "No service named" $ServiceName "on" $Computer "or the computer could not be reached."}
ELSE {Write-Host $Service "is" $Service.Status "on" $Computer.ToUpper()}
IF ($Service.Status -eq "Stopped") {StartService} # Call Start function if service is stopped
ELSEIF ($Service.Status -eq "StopPending") {KillProcess} # Forcefully kill the process
ELSEIF ($Service.Status -eq "Running" -and $count -lt 1) {KillProcess}