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

Commit

Permalink
-Added a script that keeps the Stolen status even if there is no conn…
Browse files Browse the repository at this point in the history
…ection.

 The stolen status will be activated when the url says so.
 If the pc is reported stolen and there is no connection, it will execute other modules that helps to find it and don't need internet.
 The stolen status will be removed when the url says so
  • Loading branch information
dtorres committed Jul 10, 2009
1 parent f339d12 commit 76d4f59
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions prey.sh
Expand Up @@ -28,7 +28,6 @@ fi


# ok lets get going now # ok lets get going now


os=`uname | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/"`
. $base_path/platform/base . $base_path/platform/base
. $base_path/platform/$os . $base_path/platform/$os


Expand All @@ -54,10 +53,8 @@ if [ $connected == 0 ]; then
check_net_status check_net_status
if [ $connected == 0 ]; then if [ $connected == 0 ]; then
echo "$STRING_NO_CONNECT_TO_WIFI" echo "$STRING_NO_CONNECT_TO_WIFI"
exit
fi fi
fi fi

#################################################################### ####################################################################
# if there's a URL in the config, lets see if it actually exists # if there's a URL in the config, lets see if it actually exists
# if it doesn't, the program will shut down gracefully # if it doesn't, the program will shut down gracefully
Expand All @@ -66,11 +63,19 @@ fi
if [ -n "$check_url" ]; then if [ -n "$check_url" ]; then
echo "$STRING_CHECK_URL" echo "$STRING_CHECK_URL"
check_status check_status

if [ "$status" == '200' ]; then if [ "$status" == '200' ]; then
echo -e "$STRING_PROBLEM" echo -e "$STRING_PROBLEM"
parse_headers parse_headers
process_response process_response
sed -i -e "s/pc_status='.*'/pc_status='Stolen'/" $base_path/config
elif [[ "$status" == '404' && "$pc_status" == 'Stolen' ]]; then
sed -i -e "s/pc_status='.*'/pc_status=''/" $base_path/config
echo -e "$STRING_NO_PROBLEM"
exit
elif [ "$pc_status" == 'Stolen' ]; then
echo -e "$STRING_PROBLEM"
parse_headers
process_response
else else
echo -e "$STRING_NO_PROBLEM" echo -e "$STRING_NO_PROBLEM"
exit exit
Expand All @@ -85,4 +90,3 @@ fi
echo -e " -- Running active modules..." echo -e " -- Running active modules..."
run_active_modules run_active_modules
echo -e "$STRING_DONE" echo -e "$STRING_DONE"

0 comments on commit 76d4f59

Please sign in to comment.