~ubuntu-branches/ubuntu/trusty/ldm/trusty-proposed

« back to all changes in this revision

Viewing changes to ltsp-cluster-info/ltsp-cluster-info

  • Committer: Bazaar Package Importer
  • Author(s): Vagrant Cascadian
  • Date: 2009-12-14 11:35:12 UTC
  • mfrom: (3.1.9 upstream)
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: james.westby@ubuntu.com-20091214113512-njyp6vwy2gtnxzrt
Tags: 2:2.0.52-1
* New upstream version: 
  - Force poweroff and reboot instead of going through init.
  - Provide a way to reboot or halt from within the session.
  - ldm-dialog:
    + Set the root cursor.
    + Do not display in taskbar.
    + Default to empty title.
    + Make the window not resizable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
export TEXTDOMAIN=ltsp-cluster-info
 
3
 
 
4
if [ -f /usr/bin/gettext.sh ]; then
 
5
    . /usr/bin/gettext.sh
 
6
else
 
7
    eval_gettext() {
 
8
        if [ $"test" = "\$test" ]; then
 
9
            eval "echo $*"
 
10
        else
 
11
            echo $"$*"
 
12
        fi
 
13
    }
 
14
fi
 
15
 
 
16
if [ -z "$LDM_SERVER" ]; then
 
17
    eval $(getltscfg -a -c /var/cache/getltscfg-cluster/lts.conf) || true
 
18
fi
 
19
 
 
20
if [ -z "$CLUSTER_CONFIGURED" ]; then
 
21
    title=`eval_gettext "Information on this thin client."`
 
22
else
 
23
    title=`eval_gettext "This thin client hasn't been configured yet."`
 
24
fi
 
25
 
 
26
. /etc/ltsp/getltscfg-cluster.conf
 
27
INTERFACE=$(ip route | grep default | cut -d " " -f5)
 
28
INTERFACE_MAC=$(/sbin/ifconfig | grep ${INTERFACE} | cut -f11 -d" ")
 
29
INTERFACE_IP=$(/sbin/ifconfig ${INTERFACE} | grep inet | cut -f2 -d":" | cut -f1 -d" ")
 
30
CPU=$(cat /proc/cpuinfo | grep "^model name" | head -1 | sed "s/.*: //")
 
31
RAM=$(free -m | grep "^Mem" | awk '{print $2}')
 
32
VGA=$(lspci | grep "VGA" | sed "s/.* \[//" | sed "s/\]//")
 
33
APPSERVER=${LDM_SERVER:-$RDP_SERVER}
 
34
URL="http://$SERVER/ltsp-cluster-control/Admin"
 
35
 
 
36
BROWSER=$(which firefox)
 
37
if [ -n "$BROWSER" ]; then
 
38
    URL="<a href=\"$URL\">$URL</a>"
 
39
fi
 
40
 
 
41
output=$(ldm-dialog --message "<b>${title}</b>
 
42
 
 
43
<b>`eval_gettext "MAC address"`:</b> ${INTERFACE_MAC}
 
44
<b>`eval_gettext "IP address"`:</b> ${INTERFACE_IP}
 
45
<b>`eval_gettext "CPU"`:</b> ${CPU}
 
46
<b>`eval_gettext "RAM"`:</b> ${RAM}MB
 
47
<b>`eval_gettext "Video"`:</b> ${VGA}
 
48
<b>`eval_gettext "Application server"`:</b> ${APPSERVER}
 
49
 
 
50
<b>`eval_gettext "Web interface"`:</b> ${URL}
 
51
")
 
52
 
 
53
url=$(echo $output | grep "^url: " | sed "s/^url: //g")
 
54
if [ -n "$BROWSER" ] && [ -n "$url" ]; then
 
55
    $BROWSER $url
 
56
fi