Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # /etc/portage/bashrc
- # Keep rkhunter updated
- RKHUNTER_FILES="/tmp/rkhunter.propfiles"
- RKHF=""
- RKHL=""
- if [ "${EBUILD_PHASE}" == "postinst" ];
- then
- # Only if rkhunter is installed
- if qlist -I app-forensics/rkhunter > /dev/null;
- then
- if [ "${CATEGORY}/${PN}" == "rkhunter" ] || [ ! -e "$RKHUNTER_FILES" ];
- then
- # Generate new propfiles list
- for i in $(/usr/sbin/rkhunter --list propfiles); do
- RKHF=$(/usr/bin/which ${i} 2>/dev/null)
- # Only in bash and zsh
- RKHL="${RKHL}"$'\n'"${RKHF}"
- done
- /bin/echo "$RKHL" | sed '/^$/d' > "$RKHUNTER_FILES"
- # Cleanup
- RKHF=""
- RKHL=""
- fi
- # Check and update
- for i in $(/usr/bin/qlist "${CATEGORY}/${PN}"); do
- if grep -q "$i" "$RKHUNTER_FILES";
- then
- /usr/bin/logger -t rkhook "Updating rkhunter for ${i}"
- /usr/sbin/rkhunter --propupd "$i"
- fi
- done
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement