sheppardzwc Posted June 25, 2010 Share Posted June 25, 2010 Hi guys, Just ran into a problem when trying to auto-generate something. Basically, the program I'm working with generates it's passwords in a very strange way.. I have to use it's binary to generate the password. zach@ariact:/usr/local/bin$ znc --help [ ** ] USAGE: znc [options] [config] [ ** ] Options are: ... [ ** ] -s, --makepass Generates a password for use in config But when using -s, there isn't a normal: znc -s passwordtomake, nooo, it uses an interactive prompt. This is a roadblock for me in PHP. How can I pass a string, well, a string and then the string again, then take whatever output it gives me, to generate the password? i.e. it does this: zach@ariact:/usr/local/bin$ znc -s [ ?? ] Enter Password: [ ?? ] Confirm Password: [ ** ] Use this in the <User> section of your config: [ ** ] Pass = sha256#06e9685f6fcd7466c23d797cea77818fac49b1bcd8f083f12c93246b762363d7#St/sRT.IkAhMBaXgEReG# zach@ariact:/usr/local/bin$ how can I do this via PHP's exec/system/passthru? Thanks. Link to comment https://forums.phpfreaks.com/topic/205859-interactive-prompt/ Share on other sites More sharing options...
sheppardzwc Posted June 26, 2010 Author Share Posted June 26, 2010 Bump... Link to comment https://forums.phpfreaks.com/topic/205859-interactive-prompt/#findComment-1077470 Share on other sites More sharing options...
Pikachu2000 Posted June 26, 2010 Share Posted June 26, 2010 I know this isn't the answer you're looking for, but this sounds like it's probably going to take a shell script to accomplish. Link to comment https://forums.phpfreaks.com/topic/205859-interactive-prompt/#findComment-1077494 Share on other sites More sharing options...
trq Posted June 26, 2010 Share Posted June 26, 2010 The expect extension is what your after. Link to comment https://forums.phpfreaks.com/topic/205859-interactive-prompt/#findComment-1077498 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.