tekwhe.blogg.se

Classic ftp for mac serial
Classic ftp for mac serial










classic ftp for mac serial

Todo.txt containing the commands (1 command/line) 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

classic ftp for mac serial

This TCL/expect script ssh-s into each host listed in $hostfile and executes all the commands in $scriptfile 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. Now your FTP server will have a directory full of text files with machine serial numbers in them. 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. #! /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.

classic ftp for mac serial

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. You must have FTP service turned on on a machine that the other Macs can hit.

classic ftp for mac serial

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.












Classic ftp for mac serial