We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6ed84eb commit f0d791dCopy full SHA for f0d791d
synserver
@@ -0,0 +1,27 @@
1
+#!/usr/bin/env bash
2
+
3
+# Check for correct parameters (exactly one sub-command expected)
4
+if [ "$#" -ne 1 ]; then
5
+ echo "Incorrect number of parameters; please specify 'start' or 'stop'"
6
+ exit 1
7
+fi
8
9
+# Set the name of the sub-command
10
+CMD=$1
11
12
+# Get the path of the synergys binary
13
+SYNCMD=$(command -v synergys)
14
15
+if [[ $CMD == "start" ]]; then
16
+ if pgrep -x "synergys" > /dev/null 2>&1; then
17
+ echo "Synergy server already running"
18
19
+ else
20
+ echo "Starting Synergy server"
21
+ $SYNCMD
22
+ fi
23
+elif [[ $CMD == "stop" ]]; then
24
+ pkill -x "synergys"
25
+else
26
+ echo "Unrecognized command given"
27
0 commit comments