Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

25
LINES

< > BotCompany Repo | #1007073 // Test if "Phone Server" is running on gateway

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Compilation Failed (3080L/21K).

!7

p {
  S ip = gateway();
  S url = "http://" + ip + ":7777";
  S html = loadPage(url);
  
  if (containsIC(html, "Phone server"))
    print("Phone server running (no password)");
  else if (match("No", html)) {
    print("Phone server running, but password-protected");
    S pw = loadSecretTextFile("phone-server-password");
    if (empty(pw)) print("I have no password for the server.");
    else {
      print("Trying password.");
      S html = loadPage(url + "/" + htmlQuery(password := pw));
      if (containsIC(html, "Phone server"))
        print("SUCCESS: Phone server running & I have the password!");
      else if (match("No", html))
        print("Phone server running, but I ain't got the password.");
      else
        print("No idea what's up: " + html);
    }
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

-
Snippet ID: #1007073
Snippet name: Test if "Phone Server" is running on gateway
Eternal ID of this version: #1007073/2
Text MD5: 5a2f97d36a60a0b2e72ce0228897f26d
Transpilation MD5: d76f2ba68bce46ec959163808a7388bb
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-03-02 16:30:59
Source code size: 811 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 413 / 477
Version history: 1 change(s)
Referenced in: