Update serverinformation.sh

This commit is contained in:
Ankam Ravi Kumar
2023-07-14 19:36:33 +05:30
committed by GitHub
parent 28b212487a
commit b0c7e4b010

View File

@ -3,10 +3,16 @@
mkdir -p /Inventory
sudo chmod -R 777 /Inventory/
mkdir -p /tmp/asset
touch /tmp/asset/`hostname`.txt
touch /tmp/asset/hostname.txt
if [ -f /tmp/asset/hostname.txt ];then
echo "File /tmp/asset/hostname.txt Exists"
else
mkdir /tmp/asset
touch /tmp/asset/hostname.txt
fi
touch /tmp/temptext
TEMP=/tmp/temptext
LOG=`ls /tmp/asset/*.txt`
LOG=`ls /tmp/asset/hostname.txt`
echo "## Host Information" > $LOG
echo "Host Name : `hostname` " >> $LOG
echo "`sudo /sbin/ifconfig -a |grep "inet" | awk 'BEGIN { FS = ":" } ; { print $2 }'`" >> $TEMP