On Tue, 2007-09-25 at 15:40 +0200, Sylvester Lykkehus wrote:
> It's ugly, but it works for now:
> /smart-update is exported as NFS on the local machine, and mounted on 
> /smart-update on the remote
> User has access to smart with NOPASSWD in sudoer's on both.
> 
> #!/bin/bash
> DUMP_L="/smart-update/updates_local.txt"
> DUMP_R="/smart-update/updates_remote.txt"
> PKGDIR="/smart-update/packages"
> # Get local list
> sudo smart upgrade --update --dump 2> $DUMP_L
> # Get remote list
> ssh 10.0.0.2 sudo smart upgrade --update --dump 2> $DUMP_R
> # Download packages
> smart download --target=$PKGDIR $(tr '\n' ' ' < $DUMP_L) $(tr '\n' ' ' < 
> $DUMP_R)
> # Upgrade local packages
> cd $PKGDIR;sudo smart install -y $(tr '@' '.' < $DUMP_L | xargs -i echo 
> {}.rpm | tr '\n' ' ')
> # Upgrade remote packages
> ssh 10.0.0.2 "cd $PKGDIR;sudo smart install -y $(tr '@' '.' < $DUMP_R | 
> xargs -i echo {}.rpm | tr '\n' ' ')"
> 
> 
> Not very glamorous, but it does what I want it to do.
> And I know the text processing of package names is not optimal, feel 
> free to post better ways to do it :)

I know you can add a local path (shared NFS path) as a channel in Smart.
Maybe that can help you simplify things?

Hans




E-Mail disclaimer:
http://www.sunspace.co.za/emaildisclaimer.htm
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to