[-]
[+]
|
Changed |
_service:set_version:inventory-system.spec
|
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:inventory-system-0.0.rev4313.tar.bz2/client/inventory-system.sh
^
|
@@ -1,8 +1,8 @@
#!/bin/bash
# Inventory System
# Author: Carsten Schoene
-# $LastChangedDate: 2012-11-10 15:48:38 +0100 (Sat, 10 Nov 2012) $
-# $Rev: 4309 $
+# $LastChangedDate: 2012-11-10 18:20:22 +0100 (Sat, 10 Nov 2012) $
+# $Rev: 4313 $
#
# Default options (can be changed by inventory-system.conf)
DEBUG="yes"
@@ -509,6 +509,16 @@
function get_system_hostname {
[ "`is_disabled $FUNCNAME`" == "1" ] && return
HN=`${HOSTNAME} -f`
+ if [ -z "${HN}" ] ; then
+ if [ -s /etc/sysconfig/network ] ; then
+ HN=`${CAT} /etc/sysconfig/network | ${GREP} ^HOSTNAME | ${AWK} -F= '{print $NF}'`
+ elif [ -s /etc/HOSTNAME ] ; then
+ HN=`${CAT} /etc/HOSTNAME`
+ fi
+ fi
+ if [ -z "${HN}" ] ; then
+ HN=`${HOSTNAME}`
+ fi
debug "SYSTEM-HOSTNAME: ${HN}"
echo ${HN}
}
@@ -533,6 +543,13 @@
function get_system_default_interface {
[ "`is_disabled $FUNCNAME`" == "1" ] && return
INT=`${IP} -4 route show default | ${AWK} '{print $NF}'`
+ case `get_system_type` in
+ openvz)
+ if [ "${INT}" == "venet0" ] ; then
+ INT="venet0:0"
+ fi
+ ;;
+ esac
debug "SYSTEM-DEFAULT-IFACE: ${INT}"
echo ${INT}
}
@@ -541,7 +558,7 @@
function get_system_default_interface_ip_from_int {
[ "`is_disabled $FUNCNAME`" == "1" ] && return
DEVICE=${1}
- DEFAULTIP=`${IP} -4 addr show dev ${DEVICE} | ${GREP} inet | ${HEAD} -n1 | ${AWK} '{print $2}' | ${AWK} -F/ '{print $1}'`
+ DEFAULTIP=`${IP} -4 addr show dev ${DEVICE} | ${GREP} ${DEVICE} | ${GREP} inet | ${HEAD} -n1 | ${AWK} '{print $2}' | ${AWK} -F/ '{print $1}'`
debug "SYSTEM-DEFAULT-IP: ${DEFAULTIP}"
echo ${DEFAULTIP}
}
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:inventory-system-0.0.rev4313.tar.bz2/server/client-status.php
^
|
@@ -49,7 +49,7 @@
while (( $idrow = $idres->fetchRow(MDB2_FETCHMODE_ASSOC) )) {
if ( $idrow['datakey'] == "get_system_software" ) {
// extract inventory-system
- preg_match('/inventory-system-\d+\.\d+\.rev\d+-\d+\.\d+/', $idrow['value'],$treffer);
+ preg_match('/(ix-)?inventory-system-\d+\.\d+\.rev\d+-\d+\.\d+/', $idrow['value'],$treffer);
$idrow['value'] = $treffer[0];
} elseif ( $idrow['datakey'] == "get_system_date" ) {
// convert to unix timestamp
@@ -60,7 +60,7 @@
}
}
$result = array();
-$ver = preg_replace('/-server/','',trim(exec("rpm -q inventory-system-server")));
+$ver = preg_replace('/-server/','',trim(exec("rpm -qa|grep inventory-system-server")));
$lastlogin = time() - 172800;
echo 'Server Software version: ' . $ver . ' <br/>';
echo 'Server allowed last login: ' . $lastlogin . ' (' . date("Y-m-d H:i:s",$lastlogin) . ') <br/>';
|