Update file transfer paths to saner defaults #33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Although "/var/lib/tftpboot" is the correct default directory for many TFTP servers, it's not the default path when files are copied from those servers. Many users are going to be using something like tftpd-hpa on Ubuntu. This (and many other SCP / FTP / TFTP clients) have their own root directory which is directly exposed when the user tries to copy. That is to say, if the user just copies from [email protected]/filename, they will, by default, be copying from /var/lib/tftpboot. We should put saner defaults into the script so that the user doesn't run into errors like this:
2017 Sep 27 17:53:00 switch %$ VDC-1 %$ %USER-1-SYSTEM_MSG: S/N[REDACTED]-MAC[RE:DA:CT:ED] - Command is : terminal dont-ask ; terminal password copy tftp://192.168.1.1/var/lib/tftpboot/poap.cfg.md5 bootflash:/poap.cfg.md5.tmp vrf default - script.sh
What we're really looking for (instead of "copy tftp://192.168.1.1/var/lib/tftpboot/poap.cfg.md5 bootflash:/poap.cfg.md5.tmp vrf default") is something like "copy tftp://192.168.1.1/poap.cfg.md5 bootflash:/poap.cfg.md5.tmp vrf default"
This is because those files in the TFTP (or SCP or FTP) root should be exposed directly to the user by default.