[FreeBSD] Update script - BSD

Users browsing this thread: 8 Guest(s)
yrmt
Grey Hair Nixers
This little script can be useful and is has colors ! :P


Code:
#!/bin/sh
# Author: Beastie
# FreeBSD update script with colors !
# dependencies : portmaster and portaudit,
# can be found in /usr/ports/ports-mgmt.

# log file
LOG_FILE="/var/log/freebsd-update.log"

# colors
BOLD_S="\033[1m";    
BOLD_E="\033[0m"
CYAN_S="\e[1;36m";    
CYAN_E="\e[1;36m\e[0m"
GREEN_S="\e[0;32m";    
GREEN_E="\e[1;32m\e[0m"
YELLOW_S="\e[1;33m";    
YELLOW_E="\e[1;33m\e[0m"
RED_S="\e[0;31m";    
RED_E="\e[1;31m\e[0m"
MAGENTA_S="\e[1;35m";    
MAGENTA_E="\e[1;35m\e[0m"

echo -e "${RED_S}Starting updates: \e[0m `date`\n" | tee -a ${LOG_FILE}
echo -e "${YELLOW_S}***\n"
echo -e "${RED_S}*** Checking for FreeBSD patches...\n"
echo "***"
/usr/sbin/freebsd-update fetch | tee -a ${LOG_FILE}
/usr/sbin/freebsd-update install | tee -a ${LOG_FILE}

echo -e "${GREEN_S}***\n"
echo -e "${YELLOW_S}*** Updating ports tree...\n"
echo -e "${RED_S}***\n"
/usr/sbin/portsnap fetch update | tee -a ${LOG_FILE}

echo -e "${GREEN_S}***\n"
echo -e "${YELLOW_S}*** Looking for ports to update...\n"
echo -e "${RED_S}***\n"
/usr/local/sbin/portmaster -a --no-confirm | tee -a ${LOG_FILE}

echo -e "${GREEN_S}***\n"
echo -e "${YELLOW_S}*** Checking installed ports for known security problems...\n"
echo -e "${RED_S}***\n"
/usr/local/sbin/portaudit -Fva | tee -a ${LOG_FILE}
echo -e "Finished updates: \e[0m `date`" | tee -a ${LOG_FILE}


Messages In This Thread
[FreeBSD] Update script - by yrmt - 22-07-2012, 07:24 PM
RE: [FreeBSD] Update script. - by Saos - 25-07-2012, 04:14 PM
RE: [FreeBSD] Update script. - by Amzo - 25-07-2012, 05:00 PM
RE: [FreeBSD] Update script. - by yrmt - 25-07-2012, 05:13 PM
RE: [FreeBSD] Update script. - by yrmt - 06-06-2013, 04:30 AM
RE: [FreeBSD] Update script - by berk - 06-07-2013, 12:11 PM
RE: [FreeBSD] Update script - by Mafia - 06-07-2013, 10:43 PM
RE: [FreeBSD] Update script - by Robby - 07-07-2013, 08:00 PM
RE: [FreeBSD] Update script - by yrmt - 07-07-2013, 09:40 PM
RE: [FreeBSD] Update script - by yrmt - 08-07-2013, 05:04 AM
RE: [FreeBSD] Update script - by Robby - 08-07-2013, 06:49 AM
RE: [FreeBSD] Update script - by FreeBSD - 08-07-2013, 02:57 PM