Script in GUI (Was: openSUSE as a router, how to? Solved!)



Vahis wrote:
P.S. It should have a button to do this though:

#!/bin/sh
sqlite3 /var/cache/zypp/zypp.db vacuum
rpm --rebuilddb # takes long
for fn in /var/cache/zypp/zypp.db \
/var/lib/rpm/Packages \
/var/lib/rpm/Filemd5s \
/var/lib/rpm/Dirnames \
/var/lib/rpm/Basenames
do
cp $fn $fn.new || exit 1
rm $fn
mv $fn.new $fn
done

You can have that as a button. First see to it that the script can run
as the urser that clicks it. Probably some use of sudo and edit sudoers.

Next you can use kdialog or zenity to turn it into a 'GUI'
I just don't see what the script should be doing.

The `exit 1` I would probably re-write to an errormessage that pops up
with kdialog/zenity so you know something went wrong.

houghi
--
But I will accept the rules that you feel necessary to your freedom. I am
free, no matter what rules surround me. If I find them tolerable, I
tolerate them; if I find them too obnoxious, I break them. I am free
because I know that I alone am morally responsible for everything I do.
.