Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Commit

Permalink
Move offline-actions section to response. No longer set on local config
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas committed Nov 26, 2010
1 parent 035def0 commit e11dfef
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
6 changes: 1 addition & 5 deletions config
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,9 @@ randomize_check_host='n'
# future it may prove useful. :)
extended_headers='n'

# when enabled, Prey will keep a copy of last response gotten from
# the server, and use it for instructions when no connection is found
offline_actions='y'

####################################################################
# scp/sftp posting configuration -- EXPERIMENTAL!
# we dont use user/pass but RSA keys
# for more info check http://tinyurl.com/sshtip
####################################################################

# this applies both to scp and sftp posting methods
Expand All @@ -92,6 +87,7 @@ sftp_user='username'
sftp_server='my.server.com'
sftp_path='.'


####################################################################
# SSH Tunnel config
# you can log in either by RSA key or entering the pass below
Expand Down
2 changes: 1 addition & 1 deletion config.default
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ smtp_password='password'

# you dont need to change this
mail_from='Prey <no-reply@gmail.com>'
mail_subject='[Prey] Report'
mail_subject='[Prey] Status Report'

####################################################################
# additional http options
Expand Down
5 changes: 0 additions & 5 deletions core/pull
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ check_device_status(){
curl_headers="-H X-Local-IP:$internal_ip -H X-Gateway-IP:$gateway_ip"
fi
response=`getter $curl_headers -L -i $check_url`
if [ "$offline_actions" == 'y' ]; then # we save the response in case we need it later
echo -e "$response" > "$last_response"
elif [ -f "$last_response" ]; then # otherwise, lets make sure there's nothing there
rm -f "$last_response" 2> /dev/null
fi
get_status_code
}

Expand Down
6 changes: 6 additions & 0 deletions core/response
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ process_config(){

done <<< "$STDOUT"

if [ "$offline_actions" == "true" ]; then # offline actions selected
echo -e "$response" > "$last_response"
elif [ -f "$last_response" ]; then # otherwise, lets make sure there's nothing there
rm -f "$last_response" 2> /dev/null
fi

# check the current delay against the instruction from the server

new_delay=`get_delay_for $delay`
Expand Down

0 comments on commit e11dfef

Please sign in to comment.