daily pastebin goal
44%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. rpm=$1
  4. creates=$2
  5.  
  6. if [[ -z $rpm || -z $creates ]]; then
  7.     echo "Usage: [path to rpm] [file/dir the package creates]"
  8.     exit 1
  9. fi
  10.  
  11. name=`rpm -qpi $rpm | head -n1 | awk '{print $3}'`
  12. # Check if the package (any version of it) is installed already
  13. #rpm -ql $name &>/dev/null
  14. #if [ $? == 0 ]; then
  15.     # If it's installed, don't do anything, because forcing a different
  16.     # version to be installed will prevent Puppet from installing it.
  17. #    exit 0
  18. #fi
  19.  
  20. if [ -e $creates ]; then
  21.     cd /tmp
  22.     wget -Orpm-$$.rpm $rpm
  23.     rpm -i --justdb --ignoresize rpm-$$.rpm
  24.     rm -f rpm-$$.rpm
  25. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top