diff options
author | Christopher Reimer | 2015-06-08 11:00:26 +0200 |
---|---|---|
committer | Christopher Reimer | 2015-06-08 11:00:26 +0200 |
commit | 7454df60d30e8ea111c0d084738bad254f3ad9cd (patch) | |
tree | 621d4428e018ad9e30ea6bff981f48f369ee25f4 | |
download | aur-7454df60d30e8ea111c0d084738bad254f3ad9cd.tar.gz |
Sync from VDR4Arch (https://github.com/VDR4Arch/vdr4arch/commit/3bf8a4492e3b973a559fd2c53855b231e25c7e74)
-rw-r--r-- | .SRCINFO | 25 | ||||
-rw-r--r-- | 50-systeminfo.conf | 3 | ||||
-rw-r--r-- | PKGBUILD | 40 | ||||
-rwxr-xr-x | systeminfo.sh | 111 |
4 files changed, 179 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..cc57dc68e20b --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,25 @@ +pkgbase = vdr-systeminfo + pkgdesc = displays system informations like CPU type and speed, disk and swap space etc. + pkgver = 0.1.3 + pkgrel = 19 + url = http://firefly.vdr-developer.org/systeminfo/index.html + arch = x86_64 + arch = i686 + arch = arm + arch = armv6h + arch = armv7h + license = GPL2 + depends = iproute2 + depends = lm_sensors + depends = hddtemp + depends = vdr-api=2.2.0 + backup = etc/vdr/conf.avail/50-systeminfo.conf + source = http://firefly.vdr-developer.org/systeminfo/vdr-systeminfo-0.1.3.tar.bz2 + source = systeminfo.sh + source = 50-systeminfo.conf + md5sums = 1fe264cf2059628103f134c9aba53529 + md5sums = ea31a11d19b78f30f389793ebc34c3cb + md5sums = 62018cc3ec0c08c596255821d9e7163e + +pkgname = vdr-systeminfo + diff --git a/50-systeminfo.conf b/50-systeminfo.conf new file mode 100644 index 000000000000..903e06f9bf35 --- /dev/null +++ b/50-systeminfo.conf @@ -0,0 +1,3 @@ +[systeminfo] +#--script=SCRIPT +# optional name and path of system info script (default: '/usr/lib/vdr/bin/systeminfo.sh')
\ No newline at end of file diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..1b889f94d652 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,40 @@ +# This PKGBUILD is part of the VDR4Arch project [https://github.com/vdr4arch] + +# Maintainer: Christopher Reimer <mail+vdr4arch[at]c-reimer[dot]de> +pkgname=vdr-systeminfo +pkgver=0.1.3 +_vdrapi=2.2.0 +pkgrel=19 +pkgdesc="displays system informations like CPU type and speed, disk and swap space etc." +url="http://firefly.vdr-developer.org/systeminfo/index.html" +arch=('x86_64' 'i686' 'arm' 'armv6h' 'armv7h') +license=('GPL2') +depends=('iproute2' 'lm_sensors' 'hddtemp' "vdr-api=${_vdrapi}") +#install="$pkgname.install" +_plugname=$(echo $pkgname | sed 's/vdr-//g') +source=("http://firefly.vdr-developer.org/systeminfo/${pkgname}-${pkgver}.tar.bz2" + 'systeminfo.sh' + "50-$_plugname.conf") +backup=("etc/vdr/conf.avail/50-$_plugname.conf") +md5sums=('1fe264cf2059628103f134c9aba53529' + 'ea31a11d19b78f30f389793ebc34c3cb' + '62018cc3ec0c08c596255821d9e7163e') + +prepare() { + cd "${srcdir}/${_plugname}-${pkgver}" + sed -i 's/usr\/local/usr\/lib\/vdr/g' systeminfo.c +} + +build() { + cd "${srcdir}/${_plugname}-${pkgver}" + make +} + +package() { + cd "${srcdir}/${_plugname}-${pkgver}" + make DESTDIR="${pkgdir}" install + + install -Dm755 ${srcdir}/systeminfo.sh "$pkgdir/usr/lib/vdr/bin/systeminfo.sh" + + install -Dm644 "$srcdir/50-$_plugname.conf" "$pkgdir/etc/vdr/conf.avail/50-$_plugname.conf" +} diff --git a/systeminfo.sh b/systeminfo.sh new file mode 100755 index 000000000000..5a361ecb0c8f --- /dev/null +++ b/systeminfo.sh @@ -0,0 +1,111 @@ +#!/bin/bash +# systeminfo.sh: external data collection script +# This file belongs to the VDR plugin systeminfo +# +# See the main source file 'systeminfo.c' for copyright information and +# how to reach the author. +# +# $Id$ +# +# possible output formats: +# (blanks around tabs only for better reading) +# 1) Name \t Value displays Name and Value +# 2) Name \t Value1 \t Value2 displays Name, Value1 and Value2 +# 3) Name \t total used displays an additional progress bar (percentage) after the values +# 4) s \t Name \t ... defines a static value, this line is only requested during the first cycle +# +# special keywords (they are replaced by the plugin with the actual value): +# CPU% CPU usage in percent +# +# test with: for i in $(seq 1 16); do systeminfo.sh $i;echo;done +# + +PATH=/usr/bin:/bin:/sbin + +case "$1" in + 1) # kernel version (static) + KERNEL=$(uname -rm) + echo -ne "s\tLinux Kernel:\t"$KERNEL + ;; + + 2) # distribution release (static) + DISTRI=$(grep PRETTY /etc/os-release | cut -d'"' -f2) + echo -ne "s\tDistribution:\t"$DISTRI + exit + ;; + + 3) # CPU type (static) + CPUTYPE=$(grep 'model name' /proc/cpuinfo | cut -d':' -f 2 | cut -d' ' -f2- | uniq) + echo -ne "s\tCPU Type:\t"$CPUTYPE + ;; + + 4) # current CPU speed + VAR=$(grep 'cpu MHz' /proc/cpuinfo | sed 's/.*: *\([0-9]*\)\.[0-9]*/\1 MHz/') + echo -ne "CPU speed:\t"$VAR + exit + ;; + + 5) # hostname and IP (static) + hostname=$(hostname) + dnsname=$(dnsdomainname) + IP=$(ip addr | grep inet | grep eth0 | tr -s ' ' | cut -d' ' -f3 | cut -d'/' -f1) + echo -ne "s\tHostname:\t"${hostname:-<unknown>}"."${dnsname:-<unknown>}"\tIP: "${IP:-N/A} + exit + ;; + + 6) # fan speeds + FAN1=$(sensors | grep RPM | awk 'FNR == 1' | tr -s ' ' | cut -d' ' -f2) + FAN2=$(sensors | grep RPM | awk 'FNR == 2' | tr -s ' ' | cut -d' ' -f2) + echo -ne "Fans:\tFan1: "$FAN1" rpm\tFan2: "$FAN2" rpm" + exit + ;; + + 7) # temperature of CPU and mainboard + TEMP1=$(sensors | grep high | grep °C | awk 'FNR == 1' | tr -s ' ' | cut -d' ' -f2) + TEMP2=$(sensors | grep high | grep °C | awk 'FNR == 2' | tr -s ' ' | cut -d' ' -f2) + echo -ne "Temperatures:\tTemp1: "$TEMP1"\tTemp2: "$TEMP2 + exit + ;; + + 8) # temperature of hard disks + DISK1=$(hddtemp /dev/sda | cut -d: -f1,3) + DISK2=$(hddtemp /dev/sdb | cut -d: -f1,3) + echo -ne "\t"$DISK1"\t"$DISK2 + exit + ;; + + 9) # CPU usage + echo -e "CPU time:\tCPU%" + exit + ;; + + 10) # header (static) + echo -ne "s\t\ttotal / free" + exit + ;; + + 11) # video disk usage + VAR=$(df -Pk srv/vdr/video | tail -n 1 | tr -s ' ' | cut -d' ' -f 2,4) + echo -ne "Video Disk:\t"$VAR + exit + ;; + + 12) # memory usage + VAR=$( grep -E 'MemTotal|MemFree' /proc/meminfo | cut -d: -f2 | tr -d ' ') + echo -ne "Memory:\t"$VAR + exit + ;; + + 13) # swap usage + VAR=$(grep -E 'SwapTotal|SwapFree' /proc/meminfo | cut -d: -f2 | tr -d ' ') + echo -ne "Swap:\t"$VAR + exit + ;; + test) + echo "" + echo "Usage: systeminfo.sh {1|2|3|4|...}" + echo "" + exit 1 + ;; +esac +exit |