#!/bin/sh

echo -e "\033[1;33mcompressing logs...\033[0m"
find "$(portageq envvar PORT_LOGDIR)" -type f -name "*.log" -exec xz -z -9 '{}' \; && echo -e "\033[1;32mcompressing logs finished!\033[0m" || echo -e "\033[1;31mfailed!\033[0m"


# updatedb
/root/updatedb.sh
echo -e "\033[1;33mstarting database-update...\033[0m" 
updatedb && echo -e "\033[1;32mupdating database finished!\033[0m" || echo -e "\033[1;31mfailed!\033[0m"


#echo -e "\033[1;33mgenerating static menu with icons...\033[0m"
#/usr/bin/obmenu-generator -s -i

# rsync
#if [ -e /home/jule/backup.lst ] ; then
#	echo -e "\033[1;33mbacking up filesystem...\033[0m"
#	rsync -avz --numeric-ids --delete-excluded \
#		--exclude-from=/home/jule/backup.lst \
#		-e ssh / root@192.168.4.8:/mama/root \
#		&& echo -e "\033[1;32mrsync complete\033[0m" || echo -e "\033[1;31mfailed!\033[0m"
#fi

#sed -e '/\-9999/d' -i /etc/portage/package.env
#echo "$(eix --format '<availableversions:NAMEVERSION>' --pure-packages | grep "\-9999"\
#	| sed -e 's/^/=/' -e 's/$/\ nobuildpkg/')" >> /etc/portage/package.env
#echo -e "\033[1;33mpackage.env modified!\033[0m"
