![]() |
2020-01-07
, 14:09
|
Posts: 343 |
Thanked: 819 times |
Joined on Jan 2010
@ Paris, France
|
#482
|
![]() |
2020-08-27
, 06:22
|
|
Posts: 584 |
Thanked: 1,552 times |
Joined on Sep 2019
|
#483
|
![]() |
2020-08-28
, 05:25
|
|
Posts: 584 |
Thanked: 1,552 times |
Joined on Sep 2019
|
#484
|
#!/bin/bash exec > "$HOME/situations/situations-batterybuddy.txt" 2>&1 whoami date echo $1 sleep 5 case $1 in START) if /sbin/pidof harbour-batterybuddy-daemon ; then echo "no action, harbour-batterybuddy-daemon is already running" else echo "launching harbour-batterybuddy-daemon" /usr/bin/harbour-batterybuddy-daemon & disown fi ;; STOP) if /sbin/pidof harbour-batterybuddy-daemon; then echo "killing harbour-batterybuddy-daemon" /usr/bin/killall -vw harbour-batterybuddy-daemon else echo "not killing harbour-batterybuddy-daemon because it is not running" fi ;; esac
nemo Fri Aug 28 08:18:54 EEST 2020 STOP 25045 killing harbour-batterybuddy-daemon Killed harbour-batterybuddy-daemon(25045) with signal 15
nemo Fri Aug 28 08:18:54 EEST 2020 STOP
![]() |
2020-08-29
, 16:31
|
Posts: 203 |
Thanked: 596 times |
Joined on Jan 2015
@ Finland
|
#485
|
Progress.
The command script now executes. I had to use the full path when calling it.
I had to change the script so that it takes a START and STOP option, and added full paths to all commands just to be sure, as well as some narrative for the logs:
But harbour-batterybuddy-daemon neither starts nor stops, even though this works when the script is executed manually, as a normal user.Code:#!/bin/bash exec > "$HOME/situations/situations-batterybuddy.txt" 2>&1 whoami date echo $1 sleep 5 case $1 in START) if /sbin/pidof harbour-batterybuddy-daemon ; then echo "no action, harbour-batterybuddy-daemon is already running" else echo "launching harbour-batterybuddy-daemon" /usr/bin/harbour-batterybuddy-daemon & disown fi ;; STOP) if /sbin/pidof harbour-batterybuddy-daemon; then echo "killing harbour-batterybuddy-daemon" /usr/bin/killall -vw harbour-batterybuddy-daemon else echo "not killing harbour-batterybuddy-daemon because it is not running" fi ;; esac
When executed manually, "$HOME/situations/situations-batterybuddy.txt" contains:
When executed through Situations, "$HOME/situations/situations-batterybuddy.txt" contains:Code:nemo Fri Aug 28 08:18:54 EEST 2020 STOP 25045 killing harbour-batterybuddy-daemon Killed harbour-batterybuddy-daemon(25045) with signal 15
I am stumped.Code:nemo Fri Aug 28 08:18:54 EEST 2020 STOP
PS: this is academic; at this point itwould be much more practical to just leave BatteryBuddy running and do its thing without help from Situations, but I want to know why the Command plugin isn't doing what I think it should.
The Following User Says Thank You to hhaveri For This Useful Post: | ||
![]() |
2020-08-29
, 16:35
|
Posts: 203 |
Thanked: 596 times |
Joined on Jan 2015
@ Finland
|
#486
|
![]() |
2020-08-31
, 19:20
|
|
Posts: 584 |
Thanked: 1,552 times |
Joined on Sep 2019
|
#487
|
The Following User Says Thank You to nonsuch For This Useful Post: | ||
![]() |
2020-08-31
, 19:31
|
|
Posts: 584 |
Thanked: 1,552 times |
Joined on Sep 2019
|
#488
|
![]() |
2020-09-01
, 04:47
|
Posts: 203 |
Thanked: 596 times |
Joined on Jan 2015
@ Finland
|
#489
|
Additionally I cannot concatenate the 2 Home/Elsewhere conditions into 1 because I cannot choose Wifi state a 2nd time in the same condition (to switch it off at condition end, instead of switching it off in a separate condition, as hhaveri told me).
Why?
The Following User Says Thank You to hhaveri For This Useful Post: | ||
![]() |
2020-09-02
, 06:09
|
|
Posts: 584 |
Thanked: 1,552 times |
Joined on Sep 2019
|
#490
|
Secondly you need to cover (record) cells in all network technologies (2G/3G/4G/...) and over a long time span to make it as reliable as possible. But of course the location accuracy then suffers.
![]() |
Tags |
sailfish os, situations |
|
Br,
Heikki