Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Oktokolo75920dNever did any perl, but looks, like you run that script like
script <user> <passwordOld> <passwordNew> <readonlyUser> <readonlyPassword> <address>...
<user> is the admin user name.
<passwordOld> is it's current password.
<passwordNew> is it's new password.
<readonlyUser> is the non-admin user to create.
<readonlyPassword> is it's new password.
<address> is the addresses of all devices to alter credentials on. They have to have the same admin user with the same old admin user password.
I don't think, language matters here.
It logs in to a device's admin interface and then calls the page for changing the admin password and creating the non-admin user directly using the cookie it got from the login. It does that for every device address.
You could port it to python as an exercise...
Change the shebang to /usr/bin/perl
Honestly, you should just rewrite this as a shell script or python and use ansible to run it on multiple boxes.
theKarlisK714920dThose devices also accept SSH login, I don't remember if they allow password change through it tho.
netikras2283820dLooks like cat /dev/urandom to me..