I added the full ssh path /usr/bin/ssh but it still didn’t work
so I put
ssh [email protected] "systemctl restart motion
in a shell script on the host and called that and that works.
it would be nice if I put in the shell script, there are two one for on and one for off
ssh [email protected] systemctl restart motion
sleep 3
ssh [email protected] systemctl status motion
then test for the status , maybe on the “Active” line , but not sure how to do this
â—Ź motion.service - Motion detection video capture daemon
Loaded: loaded (/etc/systemd/system/motion.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2022-11-29 13:34:33 UTC; 22min ago
Docs: man:motion(1)
Main PID: 29256 (motion)
Memory: 54.3M
CGroup: /system.slice/motion.service
└─29256 /usr/bin/motion -c /etc/motion/motion.conf -d 8
Any help appreciated