Koozali.org: home of the SME Server

Server Manager displays current update revision

Graeme Fleming

Server Manager displays current update revision
« on: May 27, 2003, 10:34:17 PM »
Hi all

I posted this a coupla weeks ago but got no reply, figured I'd give it one more shot.

Can someone point me in the right direction?? I want to be able to display the current SME update version number on the SME manager login page.

With some further digging it seems I need to modify the head.tmpl or foot.tmpl in /etc/e-smith/web/common or the initial.cgi in /etc/e-smith/web/functions (which it would seem are outside of the template system on a default build).

rpm -q SMEServer provide the output that I want displayed.

a)    how can I get this output written on the Server Manager screen??
b)    how is this value maintained when an update is installed or removed??


BTW using SME 5.5

TIA

Michiel

Re: Server Manager displays current update revision
« Reply #1 on: May 28, 2003, 02:33:15 AM »
Try this:

$ pico /etc/e-smith/events/local/update_version
#!/bin/bash
version=rpm -q SMEServer | sed "s/^SMEServer-//" | sed "s/_/ /"
/sbin/e-smith/db configuration setprop sysconfig ReleaseVersion "$version"
echo "Welcome to hostname, running on SME $version." > /etc/motd

Make this file root-executable:
$ chmod 770 /etc/e-smith/events/local/update_version
$ chown root:root /etc/e-smith/events/local/update_version

Now each time you reboot the version number will be updated in the configuration database and the server-manager will show this in the footer. As a bonus you will also see the version number each time you log-in on the console.

regards,
Michiel

Cyrus Bharda

Re: Server Manager displays current update revision
« Reply #2 on: May 28, 2003, 02:57:41 AM »
Michiel,

Thanks yet again for another brilliant addition to my SME server :-)

Just wondering, I assume that everything on the line starting with a # above is all on the one line right, no line breaks?

Thanks,

Cyrus Bharda

Michiel

Re: Server Manager displays current update revision
« Reply #3 on: May 28, 2003, 03:07:07 AM »
Hmm, no. For some reason the forum mailer removed the line breakes. Have a look at the forum webpage and you'll see the correct line breakes.

http://forums.contribs.org/index.php?topic=17501.msg68155#msg68155

Michiel

Graeme Fleming

Re: Server Manager displays current update revision
« Reply #4 on: May 28, 2003, 09:31:51 AM »
Excellent, thanks Michiel - makes maintenance processes easier for both me and my clients.

Cyrus Bharda

Re: Server Manager displays current update revision
« Reply #5 on: May 28, 2003, 11:00:20 AM »
Look at that, that is just BEAUTIFUL!, thanks again Michiel!!!!!

Cyrus Bharda