Skip to content

Commit 12dc9ad

Browse files
authored
Merge pull request #3843 from cmitu/joy2key-stop-opt
joy2key: refactor stop action
2 parents ae10c36 + 0786eab commit 12dc9ad

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scriptmodules/admin/joy2key.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ case "\$mode" in
7070
"$md_inst/\$script" "\$device" "\${params[@]}" || exit 1
7171
;;
7272
stop)
73-
pkill -f "\$script"
74-
sleep 1
73+
if pid=\$(pgrep -f "\$script"); then
74+
/sbin/start-stop-daemon --stop --oknodo --pid \$pid --retry 1
75+
fi
7576
;;
7677
esac
7778
exit 0

0 commit comments

Comments
 (0)