mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-10-28 17:32:35 +00:00
desktop-hostname.bash: includes more details of system
Signed-off-by: Jed Reynolds <jed@bitratchet.com>
This commit is contained in:
@@ -7,8 +7,21 @@ function set_background() {
|
||||
|
||||
SourceFile="/usr/share/backgrounds/mate/desktop/Ubuntu-Mate-Cold-no-logo.png"
|
||||
DesktopFile="/home/lanforge/desktop.png"
|
||||
my_version=`cat /var/www/html/installed-ver.txt`
|
||||
my_hostname=`hostname`
|
||||
my_os="[os]"
|
||||
if [ -f /etc/os-release ]; then
|
||||
my_os=`egrep '^VERSION=' /etc/os-release`
|
||||
if [ ! -z "$my_os" ]; then
|
||||
my_os="${my_os/VERSION=/}"
|
||||
my_os="${my_os//\"/}"
|
||||
fi
|
||||
fi
|
||||
|
||||
my_inver="[lfver]"
|
||||
if [ -f "/var/www/html/installed-ver.txt" ]; then
|
||||
my_inver=`cat /var/www/html/installed-ver.txt`;
|
||||
fi
|
||||
my_kver=`uname -r`
|
||||
my_dev=`ip ro sho | awk '/default via/{print $5}'`
|
||||
my_ip=`ip a sho $my_dev | awk '/inet /{print $2}'`
|
||||
my_mac=`ip a sho | grep -A1 "$my_dev" | awk '/ether /{print $2}'`
|
||||
@@ -18,8 +31,10 @@ X=220
|
||||
Y=150
|
||||
convert -pointsize 80 -fill "#$fill_color" -stroke black -strokewidth 1 \
|
||||
-draw "text $X,$Y \"$my_hostname\"" \
|
||||
-draw "text $X,$(( Y + 75 )) \"$my_dev $my_ip\"" \
|
||||
-draw "text $X,$(( Y + 150 )) \"$my_mac\"" \
|
||||
-draw "text $X,$(( Y + 75 )) \"LANForge $my_inver\"" \
|
||||
-draw "text $X,$(( Y + 155 )) \"Kernel $my_kver $my_os\"" \
|
||||
-draw "text $X,$(( Y + 225 )) \"$my_dev $my_ip\"" \
|
||||
-draw "text $X,$(( Y + 295 )) \"$my_mac\"" \
|
||||
$SourceFile \
|
||||
-scale 1600x900 \
|
||||
$DesktopFile
|
||||
|
||||
Reference in New Issue
Block a user