#!/bin/bash
####################################################################
# Prey Session Module Core Functions - by Tomas Pollak (bootlog.org)
# URL: http://preyproject.com
# License: GPLv3
####################################################################

get_uptime(){
	uptime=`uptime 2> /dev/null`
}

get_running_programs() {
	running_programs=`ps aux | grep -v root`
}

locate_path(){
	if [ "$session__modified_files_path" == '~/' ]; then
		find_path=`eval echo $home_path`
	else
		find_path=`eval echo $session__modified_files_path`
	fi
}

get_modified_files() {
	# we dont include hidden files
	modified_files=`find $find_path \( ! -regex '.*/\..*/..*' \) -type f -mmin -$session__modified_files_time 2> /dev/null`
}

compress_screenshot() {
	log " -- Compressing screenshot..."
	tar zcf $session__screenshot.tar.gz $session__screenshot
	session__screenshot=$screenshot.tar.gz
}
