Oh! Thank you very much for the fd!
HTTP_PW="$(pwgen 43 1)"
wgetrc() {
echo http-user=user
echo http-password=$HTTP_PW
}
WGETRC="<(wgetrc)" wget -d http://www.secretsite.net
Idézem/Quoting Ángel González <[email protected]>:
I *think* wget only reads the wgetrc file once. So, provided you are
using bash (you are) and run it on a OS with support for reading a
fd from a path in /proc (which is also most likely) then you can
replace the wgetrc with a script, which presumably can determine if
it's safe to decrypt the secret and retrieve the password from
secure storage.
$ cat script.sh
#!/bin/sh
echo http-user=user
echo http-password=$(pwgen 43 1)
And then we can run:
WGETRC=<(./script.sh) wget -d http://www.secretsite.net
which would provide a different password for accesing the site on each run.
Szépe Viktor
--
+36-20-4242498 [email protected] skype: szepe.viktor
Budapest, XX. kerület