#!/bin/bash
#rug_up_minus_kernel.sh
#
# This script is intended to apply updates from rug without installing the kernel updates.
# 

RUGBIN=`which rug`

TMPPatches=`mktemp -t patches.XXXXXXXXXX` || exit 1

if [ -e $RUGBIN ]; then
$RUGBIN lu | sed -e '/--/ d' -e '/Name/ d' -e '/kernel/ d' | awk '{ OFS="-"; print $6,$8 }' | tr "\n" " " | sed -e '$s/-.$//' -e '1s/..//' >> $TMPPatches

update=`<$TMPPatches`
if [ "$update" != "" ]; then
echo "Executing rug to patch your system..."

# You can add a -y to supress the yes/no option given
# $RUGBIN in $update -y
$RUGBIN in $update 

else 
echo "No Updates Available."
fi
fi

rm $TMPPatches


