Jump to content

Continuous terminal commands (TFTP)

Recommended Posts

I am attempting to create a workflow that allows me to turn on the built in TFTP server in Mac OS, followed (or before) opening a particular finder window and the creating of a file.
The commands need to be;
To launch the daemon run the following commands:
sudo launchctl load -F /System/Library/LaunchDaemons/tftp.plist
sudo launchctl start com.apple.tftpd

Be sure Read/Write/eXecute permissions are set on the tftpboot folder and any files you wish to transfer:
sudo chmod 777 /private/tftpboot
sudo chmod 777 /private/tftpboot/*

If you’ll be transferring a file TO your TFTP server, the file will technically need to exist on the server beforehand so create it with touch. For example:
sudo touch /private/tftpboot/running-config
sudo chmod 777 /private/tftpboot/running-config

I have created (along with the help of a friend) the following workflow. What I would like to do;
1. Is create it so it opens up the finder location first (I can then visibly see the file being created because atm I pre-open the finder window manually). I cannot get this piece to work.
2. Include all of the terminal commands into just on window, with a "sleep x" in between the command lines, and then it auto close that window (I found this, its a preference in terminal rather than a cmd).
3. Close terminal totally. i.e. The entire program.
I can share the created workflow, but you will need to replace the "1" in the commands with your Mac PW. Just trying to workout how to do the upload of a workflow....
Many, many thanks for any help or advice you can offer.

Link to comment
  • 3 weeks later...

For (1), run the command open /private first (that opens /private in Finder).


For (2), you can only (easily) send a single command to Terminal. What you need to do is join your commands with && or ;:


sudo launchctl load -F /System/Library/LaunchDaemons/tftp.plist && sudo launchctl start com.apple.tftpd ...


To close the terminal afterwards, add ; exit to the end of the command, or to close the entire application, run osascript -e 'tell application "Terminal" to quit')


You shouldn't put your Mac password in workflows. Instead, edit sudoers to allow your user to run those commands without a password (you still need sudo, though).

Edited by deanishe
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...