This is a Perl script I wrote and used for the migration of a linux DHCP server (running dhcpd to a Windows DHCP server. The script looks in the dhcpd.conf configuration file for fixed reservations and exports these to a CSV for processing and importing in another server.
Usage is simple, as it takes its input from STDIN and outputs to STDOUT.
cat /etc/dhcpd.conf | perl export-dhcpd-reservations.pl > output.csv
The script is very simple and can probably do with a lot of improvements, but it's a start for anyone willing to develop it further. It is licensed as GPLv3.
You can change the delimiter of a for-loop by changing the value of the global variable $IFS. By default this is set to a space.
For example, if you want the delimiter to be a new line, set it like so:
IFS=$'n'
I found NcFTP to be a useful toolkit for use in scripting. Aside of a linux version, it also has precompiled binaries for Mac and Windows.
The toolkit contains different programs which are very useful for use in various scripting (such as automatic file upload/download, and more). Both regular FTP and SFTP are supported.
« ‹ | November 2024 | › » | ||||
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |