1

cleanup gen_issue.sh

This commit is contained in:
eleksir
2016-09-04 23:37:05 +03:00
parent 034a80d44e
commit 2ed0ca1604

View File

@@ -1,15 +1,17 @@
#!/bin/sh
BOND_SUP=`/sbin/getcfg "Network" "BONDING Support" -d "FALSE"`
BOND_SUP=$(/sbin/getcfg "Network" "BONDING Support" -d "FALSE")
if [ "$BOND_SUP" = "TRUE" ]; then
IP=`/sbin/ifconfig bond0 | grep "inet addr" | cut -f 2 -d ':' | cut -f 1 -d ' '`
IP=`/sbin/ifconfig bond0 | /bin/awk '{ if ($1 == "inet") { str = $2; split(str, a, ":"); print a[2];} }'`
else
IP=`/sbin/ifconfig eth0 | grep "inet addr" | cut -f 2 -d ':' | cut -f 1 -d ' '`
IP=`/sbin/ifconfig eth0 | /bin/awk '{ if ($1 == "inet") { str = $2; split(str, a, ":"); print a[2];} }'`
fi
if [ "`/sbin/getcfg "Project" "Name" -d "null" -f /var/default`" != "null" ]; then
if [ "$(/sbin/getcfg "Project" "Name" -d "null" -f /var/default)" != "null" ]; then
echo "" > /etc/issue
echo -n "Welcome to `/sbin/getcfg System Model -d NAS`, " >> /etc/issue
echo "`/sbin/getcfg System Manufacturer -f /etc/default_config/uLinux.conf`." >> /etc/issue
echo "$(/sbin/getcfg System Manufacturer -f /etc/default_config/uLinux.conf)." >> /etc/issue
echo "" >> /etc/issue
elif [ -f /etc/IS_G ]; then
echo "" > /etc/issue
@@ -17,7 +19,6 @@ elif [ -f /etc/IS_G ]; then
echo "" >> /etc/issue
else
echo "" > /etc/issue
echo "Welcome to `/sbin/getcfg System Model -d NAS`($IP), QNAP Systems, Inc." >> /etc/issue
echo "Welcome to $(/sbin/getcfg System Model -d NAS)($IP), QNAP Systems, Inc." >> /etc/issue
echo "" >> /etc/issue
fi