posts /

HP J9141A config restore

Posted Wed 10 Sep 2008 10:46:49 AM CEST in

The HP J9141A is a 802.11a/b/g Access point with Power-over-Ethernet. It runs an OpenWRT native to which HP up to now did not release the source. I mailed them - no answer. Now i tried restoring a config on one of those beasts and guess what? It fails - there is no way to restore the config from linux - you need a windows. HP tried to very clever and parses the config backups filename in javascript and trys to detect whether its linux or windows:

var win_file_name=filestr.substr(filestr.lastIndexOf("\\\\\")+1); var unix_file_name=filestr.substr(filestr.lastIndexOf("/")+1); if(win_file_name == filestr && unix_file_name != filestr) file_name=unix_file_name; else if( win_file_name != filestr && unix_file_name == filestr) file_name=win_file_name; else { alert(invalid_filename); return false; }

Now i hacked around and did it with curl as neither firefox 3 nor epiphany was getting around this. Dont try to be clever when you have no clue ...

curl -u admin:password -F "filename=@AP1.cfg;restore=Restore"