Skip to content

Commit 3b38df7

Browse files
authored
Merge pull request #59 from jesterret/patch-1
Allow script to be started from any location
2 parents ae0e0b0 + 1a67618 commit 3b38df7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

examples/install-service.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/bash
2+
3+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
24
ON_THRESHOLD=65
35
OFF_THRESHOLD=55
46
HYSTERESIS=5
@@ -170,8 +172,8 @@ After=multi-user.target
170172
171173
[Service]
172174
Type=simple
173-
WorkingDirectory=$(pwd)
174-
ExecStart=$(pwd)/automatic.py --on-threshold $ON_THRESHOLD --off-threshold $OFF_THRESHOLD --delay $DELAY --brightness $BRIGHTNESS $EXTRA_ARGS
175+
WorkingDirectory=$DIR
176+
ExecStart=$DIR/automatic.py --on-threshold $ON_THRESHOLD --off-threshold $OFF_THRESHOLD --delay $DELAY --brightness $BRIGHTNESS $EXTRA_ARGS
175177
Restart=on-failure
176178
177179
[Install]

0 commit comments

Comments
 (0)