Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't load or set up trigger at runtime. We'll do that during install…

…ation.
  • Loading branch information...
commit 7af138840f824c13bdb8bf17fe998b0fb8d21ace 1 parent 980e442
Tomás Pollak tomas authored
Showing with 13 additions and 8 deletions.
  1. +13 −5 core/functions
  2. +0 −3  prey.sh
18 core/functions
View
@@ -214,7 +214,9 @@ update_execution_delay(){
check_and_update_delay(){
local current_delay=$(get_current_delay)
- if [ -n "$device_missing" ]; then
+ # if device is missing, or trigger is not loaded, set delay
+ if [[ -n "$device_missing" || -z "$(is_trigger_loaded)" ]]; then
+
local new_delay=$(get_delay_for "$1")
if [ "$current_delay" != "$new_delay" ]; then
@@ -225,16 +227,22 @@ check_and_update_delay(){
elif [[ -z "$current_delay" || -z "$(one_hour_interval)" ]]; then
log " -- Setting delay to regular interval."
- [ "$os" == "windows" ] && local new_delay=$(get_delay_for 60) || local new_delay="$(get_delay_for $(get_random_number 59))"
+
+ if [ "$os" == "windows" ]; then
+ local new_delay=$(get_delay_for 60)
+ else
+ local new_delay="$(get_delay_for $(get_random_number 59))"
+ fi
+
update_execution_delay "$new_delay"
fi
}
-ensure_trigger_loaded(){
- [ -z "$(is_trigger_loaded)" ] && reload_trigger
-}
+#ensure_trigger_loaded(){
+# [ -z "$(is_trigger_loaded)" ] && reload_trigger
+#}
running_from_cron(){
# tty -s
3  prey.sh
View
@@ -185,7 +185,4 @@ if [[ -z "$on_demand_call" && "$on_demand_mode" == "true" ]]; then
enable_on_demand_mode
fi
-# makes sure net trigger is loaded, either using LaunchDaemon (mac) or init script (linux)
-ensure_trigger_loaded
-
# exit 0
Please sign in to comment.
Something went wrong with that request. Please try again.