hostname=$(hostname) #mount shared drive mount -t cifs -o username= ,password= //111.111.111.111/MLC /mnt #delete file if it already exists locally if [ -f /$hostname.txt ]; then rm -f /$hostname.txt fi #delete file if it exists in the share if [ -f /mnt/$hostname.txt ]; then rm -f /mnt/$hostname.txt fi #create new file touch $hostname.txt #redirect ip details to the file ifconfig>$hostname.txt #copy to the mounted share cp /$hostname.txt /mnt/$hostname.txt #unmount umount /mnt
ifconfig
$hostname.txt
etc/rc
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)