Skip to content

Commit

Permalink
Backup
Browse files Browse the repository at this point in the history
  • Loading branch information
GideonLeGrange committed Jan 18, 2021
1 parent 0f312c2 commit 3424482
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/examples/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/
public class Config {

public static final String HOST = "192.168.1.25";
public static final String USERNAME = "admin";
public static final String PASSWORD = "";
public static final String HOST = "ce2.ter.cpt.adept.za.net";
public static final String USERNAME = "adept";
public static final String PASSWORD = "34ffp9";

}
28 changes: 28 additions & 0 deletions src/main/java/examples/ScriptCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package examples;

import me.legrange.mikrotik.MikrotikApiException;

/**
* Example 1: A very simple command: Reboot the remote router
* @author gideon
*/
public class ScriptCommand extends Example {

public static void main(String...args) throws Exception {
ScriptCommand ex = new ScriptCommand();
ex.connect();
ex.test();
ex.disconnect();
}

private void test() throws MikrotikApiException {
con.execute("/ip/hotspot/user/profile/add name=\"cahyo-cek-2\" idle-timeout=none keepalive-timeout=2m status-autorefresh=1m shared-users=1 add-mac-cookie=true mac-cookie-timeout=3d parent-queue=none rate-limit=512k/512k on-login=:put(\",re,3000,12d,3000,,Enable,\")");
}

///
/*
/ip/hotspot/user/profile/add name="cahyo-cek-2" idle-timeout=none keepalive-timeout=2m status-autorefresh=1m shared-users=1 add-mac-cookie=true mac-cookie-timeout=3d parent-queue=none rate-limit=512k/512k on-login=:put (",re,3000,12d,3000,,Enable,");
/system scheduler add name="usercahyo-cek-2-$user" interval=12:00:00 on-even="/ip hotspot active remove [find user=\"$user\"] ; /ip hotspot user set \"$user\" disable=yes ; /system scheduler remove [find name=usercahyo-cek-2-$user]"
*/

}

0 comments on commit 3424482

Please sign in to comment.