config is in prey 0.6.2-1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | #!/bin/bash
set -e
# Source debconf library.
. /usr/share/debconf/confmodule
# Modules
modules_path="/var/lib/prey/modules"
is_module_active(){
if [ -x "$modules_path/$1/core/run" ]; then
return 0
else
return 1
fi
}
is_module_selected(){
local module="$1"
shift
echo "$@" | grep -w "$module" 1>/dev/null
return "$?"
}
if [ -d "$modules_path" ]
then
# How many mods are installed?
installed_mods=(`find "$modules_path" -maxdepth 1 -mindepth 1 -type d -exec basename {} \;`)
mods_count=${#installed_mods[@]}
for (( i=0; i < mods_count; i++ )); do
if [ $i -eq 0 ]; then
choices="${installed_mods[$i]}"
if is_module_active "${installed_mods[$i]}"
then
default="${installed_mods[$i]}"
fi
else
choices="$choices, ${installed_mods[$i]}"
if is_module_active "${installed_mods[$i]}"
then
default="$default, ${installed_mods[$i]}"
fi
fi
done
db_subst prey/active_modules choices $choices
db_set prey/active_modules "$default"
db_input medium prey/active_modules || true
db_go || true
db_get prey/active_modules
SELECTED_MODS="${RET//,/}"
#installed_mods="${installed_mods[@]}"
for module in "${installed_mods[@]}" ; do
#for (( i=0; i < mods_count; i++ )); do
# module="${installed_mods[$i]}"
if [ -e "$modules_path/$module/core/run" ]; then
if is_module_selected "$module" "$SELECTED_MODS"
then
chmod 744 "$modules_path/$module/core/run"
else
chmod 644 "$modules_path/$module/core/run"
fi
fi
done
fi
if [ -f "/etc/cron.d/prey" -a -n "$(grep 'prey.sh' /etc/cron.d/prey | egrep -v '^#|^#$|^\s+#')" ]
then
# Frequency of reports and actions
let current_timing=`grep 'prey.sh' /etc/cron.d/prey | head -1 | sed 's/ root.*//' | sed -e 's|^\*/\([0-9]\+\).*|\1|'`
db_input low prey/reporting_frequency || true
db_set prey/reporting_frequency "$current_timing"
db_go || true
db_get prey/reporting_frequency
let TIMING="$RET"
if [ $TIMING -ge 5 ]; then
# frequency must be greater than 5 minutes
sed -i -e "s|^\*/\([0-9]\+\)\(.*\)|\*/$TIMING\2|" /etc/cron.d/prey
fi
fi
# Show a text message
db_input low prey/edit_config || true
db_go || true
exit 0
|