User Tools

Site Tools


public:scripts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
public:scripts [2017/09/07 07:59] Roland Hansmannpublic:scripts [2018/02/06 11:10] (current) – [accounts.sh] Roland Hansmann
Line 1283: Line 1283:
  
 # edit # edit
-vi $ACCOUNTFILE+$VIBIN $ACCOUNTFILE
  
 # encrypt new file and overwrite existing one # encrypt new file and overwrite existing one
Line 1582: Line 1582:
 ifconfig $MON down ifconfig $MON down
 </file> </file>
 +==== spacewalk-package-installed ====
 +This script shows which servers have installed a specific package
 +<file bash spacewalk-package-installed>
 +#!/bin/bash
 +PACKAGE=$1
 +VERSION=$2
 +RELEASE=$3
  
 +[[ $@ -ne 3 ]] && { echo "Usage: $0 packagename version release"; exit 2; }
 +
 +for id in `/usr/bin/spacewalk-report system-packages-installed \
 +           --where-package_name=$PACKAGE \
 +           --where-package_version=$VERSION \
 +           --where-package_release=$RELEASE \
 +           |cut -f1 -d, |grep -v ^system_id`
 +        do
 +           /usr/bin/spacewalk-report inventory \
 +           --where-server_id=$id \
 +           |cut -f3 -d, |tail -1
 +done
 +</file>
 ===== C ===== ===== C =====
  
public/scripts.1504771147.txt.gz · Last modified: 2017/09/07 07:59 by Roland Hansmann