PDA

View Full Version : Ubuntu release file?



linux2512
October 3rd, 2006, 10:04 AM
I was wondering if there's a good way for my app to determine the Ubuntu release of the PC the app is running on other than /etc/issue?
On RedHat/Fedora there the /etc/redhat-release and SuSE there's /etc/SuSE-release.

Any help is appreciated.

Thanks

nemin
October 3rd, 2006, 09:23 PM
I was wondering if there's a good way for my app to determine the Ubuntu release of the PC the app is running on other than /etc/issue?
Hm, perhaps you could use apt's sources.list? Though there should be a better way...

linux2512
October 4th, 2006, 06:44 PM
Hm, perhaps you could use apt's sources.list? Though there should be a better way...

The sources.list file doesn't have any version information. I agree, there really has to be a better way.

Engnome
October 4th, 2006, 06:54 PM
# Are we running on Dapper?
if ( ! grep "Ubuntu 6.06" /etc/issue >/dev/null 2>&1); then
echo "This script is only intended for Ubuntu 6.06 Dapper Drake"
exit 1
fi

code taken from "faster dapper" (GPL 2)

linux2512
October 4th, 2006, 07:21 PM
# Are we running on Dapper?
if ( ! grep "Ubuntu 6.06" /etc/issue >/dev/null 2>&1); then
echo "This script is only intended for Ubuntu 6.06 Dapper Drake"
exit 1
fi

code taken from "faster dapper" (GPL 2)

Thanks Engnome, that's what I'm currently doing, but the problem with that is a lot of people (my self included) modify the /etc/issue and /etc/motd files to customize the login prompt and when you login remotely so it's not that reliable.