Project

General

Profile

Feature #883

OS Variable available to be used in install scripts

Added by SolaR over 8 years ago. Updated almost 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
02/28/2012
Due date:
% Done:

0%


Description

Because there are some differences between how an OS needs to be used (i.e. chkconfig in Fedora and update-rc.d in Ubuntu) the installer needs to have a variable that can be used in for example an if-statement to do OS specific tasks.

I think setting the variable to "rpm" or "deb" would be enough to do the job.

History

#1 Updated by bigfoot65 over 8 years ago

This can be done by using the following code:

export FVER=`cat /etc/fedora-release | awk -F'release ' '{print $2}' | sed 's/(Laughlin)//'`;
if [ $FVER == '14' ]; then
...
fi

or

export FVER=`cat /etc/fedora-release | awk -F'release ' '{print $2}' | sed 's/(Verne)//'`;
if [ $FVER == '16' ]; then
...
fi

The same would apply for Ubuntu I would presume.

#2 Updated by bigfoot65 almost 8 years ago

  • Priority changed from High to Medium

#3 Updated by bigfoot65 almost 8 years ago

  • Priority changed from Medium to Normal

Also available in: Atom