Todo. You still have to set the variable user in the script to your login in the script file you specify each command line with full pathname The script assumes you have thesame $user on each $host it will prompt you once for the password which you can enter without it being displayed and it will try to log in into each host and execute the commands, logging _everything_ in $host.output in your current working directory This TCL/expect script ssh-s into each host listed in $hostfile and executes all the commands in $scriptfile MacScan Comodo Antivirus for Mac Free Protect your Mac against viruses, worms and Trojan horses. I ran into this problem myself when I had to collect system information on a decent amount of hosts so I wasted an evening coming up with something that'd do the job for me I'd comment out the echo lines, as I was using them for debugging. Quick and dirty, but it did what I needed it to do. It was the first antispyware program released for Mac OS X. It is aimed at removing malware (including spyware, Trojan horses, keystroke loggers, and tracking cookies). Now your FTP server will have a directory full of text files with machine serial numbers in them. MacScan is an antimalware utility for Apples Mac OS X developed by SecureMac. Then it FTPs that file to a server you specify and deletes the text file on the machine. It basically creates a text file on the machine it's running on, names it after the machine's hostname, puts the machine's hostname in the file, and greps the output of system_profiler for anything with "serial number" in the line and throws it in the text file as well. How can I check if my USB device is properly detected by Mac OS Click the Apple icon. #! /bin/tcshset FTP_ADDRESS=set FTP_LOGIN=set FTP_PASSWORD=set FTP_PATH=echo "Changing to home directory."cd ~echo "Setting hostname variable."set MAC_NAME=$HOSTecho "Creating text file."touch $MAC_NAME.txtecho "Writing hostname to file."echo $MAC_NAME > ~/$MAC_NAME.txtecho "Writing return carriage to file."echo "" > ~/$MAC_NAME.txtecho "Writing grepped serial number to file."system_profiler | grep -i "serial number" > ~/$MAC_NAME.txtecho "FTPing the file."curl -T ~/$MAC_NAME.txt -u $FTP_LOGIN:$FTP_PASSWORD ftp://$FTP_ADDRESS/$FTP_PATHecho "Removing original text file."rm ~/$MAC_NAME.txtecho "Complete!"This can be prettied up, so any changes are welcome. Read the rest of the hint for the script. This has been tested with OS X 10.2.x with the default C shell. Then you can send and run it via Remote Desktop. You can run the script remotely via telnet/ssh, or you can make a package and have this script run as the pre /post install script. Edit the $FTP_ADDRESS, $FTP_LOGIN, $FTP_PASSWORD, and $FTP_PATH variables and you're done. Colasoft MAC Scanner is used for scanning IP address and MAC address. You must have FTP service turned on on a machine that the other Macs can hit. I needed a way to get machine serial numbers on my network and that feature is not in Remote Desktop, so I decided to do it my own way.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |