Skip to content

Commit 928ff57

Browse files
committed
adjusting
1 parent 1d2bbed commit 928ff57

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/main/java/com/mageddo/linux/bluetoothfix/BluetoothConnector.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ boolean disconnect(String deviceId) {
6868
}
6969

7070
CommandLines.Result restartService() {
71+
72+
log.warn("systemctl will ask you for root password to restart bluetooth service ...");
73+
7174
final CommandLine cmd = new CommandLine("/bin/sh")
7275
.addArguments(new String[]{
7376
"-c",

src/main/java/com/mageddo/linux/bluetoothfix/Main.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
@Slf4j
66
public class Main {
77
public static void main(String[] args) {
8-
9-
if (!Linux.runningAsRoot()) {
10-
log.warn("you need to run as root due to restart bluetooth service, exiting...");
8+
if(args.length == 0){
9+
log.warn("pass the bluetooth device id which you want to connect to, ex: \"94:CC:56:E5:72:85\"");
1110
System.exit(1);
1211
}
13-
new BluetoothConnector().connect("94:DB:56:F5:78:41");
12+
new BluetoothConnector().connect(args[0]);
1413
}
1514

1615
}

0 commit comments

Comments
 (0)