Skip to content

Commit 82b601f

Browse files
Update README.md
1 parent 60b97b9 commit 82b601f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,24 @@ If you're using Maven, that looks like this:
2121
</dependency>
2222
```
2323
If you're using Gradle, that looke like this:
24-
```
24+
```gradle
2525
implementation group: 'io.github.DarkAssassinator', name: 'ssh-spring-boot-starter', version: '1.0.0'
2626
```
2727
Next, you can instantiate a SSH Session pool like
28-
```
28+
```java
2929
@Autowired
3030
private SshSessionPool sessionPool;
3131
```
3232
Then you should create a SSH Session Host Entity named `SshSession`. See the example below:
33-
```
33+
```java
3434
SshSession sshSession = new SshSession();
3535
sshSession.setIp("xx.xx.xx.xx");
3636
sshSession.setPort(22);
3737
sshSession.setAccount("root");
3838
sshSession.setPassword("this is a password");
3939
```
4040
Next, you can borrow a session holder from SessionPool.
41-
```
41+
```java
4242
SshSessionHolder sessionHolder = null;
4343
try {
4444
sessionHolder = sessionPool.getSessionHolder(sshSession);
@@ -49,7 +49,7 @@ try {
4949
}
5050
```
5151
How to execute shell command:
52-
```
52+
```java
5353
sessionHolder.execCommand("echo 'hello world'");
5454
```
5555

0 commit comments

Comments
 (0)