We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 28b2124 commit b0c7e4bCopy full SHA for b0c7e4b
serverinformation.sh
@@ -3,10 +3,16 @@
3
mkdir -p /Inventory
4
sudo chmod -R 777 /Inventory/
5
mkdir -p /tmp/asset
6
-touch /tmp/asset/`hostname`.txt
+touch /tmp/asset/hostname.txt
7
+if [ -f /tmp/asset/hostname.txt ];then
8
+ echo "File /tmp/asset/hostname.txt Exists"
9
+else
10
+ mkdir /tmp/asset
11
+ touch /tmp/asset/hostname.txt
12
+fi
13
touch /tmp/temptext
14
TEMP=/tmp/temptext
-LOG=`ls /tmp/asset/*.txt`
15
+LOG=`ls /tmp/asset/hostname.txt`
16
echo "## Host Information" > $LOG
17
echo "Host Name : `hostname` " >> $LOG
18
echo "`sudo /sbin/ifconfig -a |grep "inet" | awk 'BEGIN { FS = ":" } ; { print $2 }'`" >> $TEMP
0 commit comments