Skip to content

Instantly share code, notes, and snippets.

@ShekharReddy4
Created August 22, 2017 13:29
Show Gist options
  • Save ShekharReddy4/36e871ed63e916db8218457810b4c709 to your computer and use it in GitHub Desktop.
Save ShekharReddy4/36e871ed63e916db8218457810b4c709 to your computer and use it in GitHub Desktop.
#!/bin/bash
#AssetTag
AssetTag=`hostname`
printf "\n" >> service2.txt
echo "AssetTag: "$AssetTag >> service2.txt
# MacID
macID=$(ifconfig en1 | awk '/ether/{print $2}')
echo "MAC ID: "$macID >> service2.txt
# Ip Address
ipAddr=$(ipconfig getifaddr en1)
echo "Ip Address: "$ipAddr >> service2.txt
#OS Name
osName=$(sw_vers -productName)
echo "OS Name: "$osName >> service2.txt
# OS Version
osVersion=$(sw_vers -productVersion)
echo "ServicePack: "$osVersion >> service2.txt
# OS Installation Date
osInstallDate=$(head -1 /var/log/install.log | awk '{print $1, $2, $3;}')
echo "os Installation Date: "$osInstallDate >> service2.txt
# Processor
processor=$(sysctl machdep.cpu.brand_string)
echo "Processor: "$processor >> service2.txt
# HardWare
hardwareInfo=$(system_profiler SPHardwareDataType | grep "Memory:")
echo $hardwareInfo >> service2.txt
# SDD
hddsz=$(diskutil info / |grep "Total Space")
echo $hddsz >> service2.txt
# Total Softwares
# totalsw=$(sudo find / -iname *.app)
# echo $totalsw
#dbs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment