aboutsummaryrefslogtreecommitdiff
path: root/src/Main.java
blob: 8b6f2002efc4318ee401e67239d35e27f7013a94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import org.traccar.Server;
import org.traccar.helper.Log;

public class Main {

    public static void main(String[] args) throws Exception {

        final Server service = new Server();
        service.init(args);

        Log.info("starting server...");
        service.start();

        // Shutdown server properly
        Runtime.getRuntime().addShutdownHook(new Thread() {
            @Override
            public void run() {
                Log.info("shutting down server...");
                service.stop();
            }
        });

    }
}