Advertisement
Guest User

repo_search

a guest
Dec 14th, 2012
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.29 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. packageLoc='/path/to/packages'
  4. repoLoc='/path/to/repo'
  5. yum list $1 | grep $1
  6.  
  7. if [ $? != 0 ];
  8.   then
  9.     echo 'Not available, adding to repo.'
  10.     cp $packageLoc$1* $repoLoc
  11.     createrepo $repoLoc
  12.     echo $1 'Copied to repo.'
  13. else
  14.     echo $1 'Already exists in the repo.'
  15. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement