1
Files
qnap-rc-scripts/gen_issue.sh
2016-09-04 22:20:40 +03:00

24 lines
840 B
Bash
Executable File

#!/bin/sh
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 ' '`
else
IP=`/sbin/ifconfig eth0 | grep "inet addr" | cut -f 2 -d ':' | cut -f 1 -d ' '`
fi
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 "" >> /etc/issue
elif [ -f /etc/IS_G ]; then
echo "" > /etc/issue
echo -n "Welcome to NAS Server" >> /etc/issue
echo "" >> /etc/issue
else
echo "" > /etc/issue
echo "Welcome to `/sbin/getcfg System Model -d NAS`($IP), QNAP Systems, Inc." >> /etc/issue
echo "" >> /etc/issue
fi