Commit 37c62e42 authored by Franco Fichtner's avatar Franco Fichtner

tmp: not needed

parent 2862298e
#!/bin/sh
/usr/local/etc/rc.conf_mount_rw
PFSENSETYPE=`cat /usr/local/etc/platform`
if [ $PFSENSETYPE = "pfSense" ] || [ $PFSENSETYPE = "nanobsd" ]; then
touch /conf/needs_package_sync
fi
# Detect interactive logins and display the shell
detect_command='[ -n "$SSH_TTY" -o "$TERM" = "cons25" ] && exec /usr/local/etc/rc.initial'
echo "$detect_command" > $CVS_CO_DIR/root/.shrc
echo "$detect_command" >> $CVS_CO_DIR/root/.profile
# Now turn on or off serial console as needed
echo "Checking for /tmp/$1/tmp/post_upgrade_command.php... " >> /conf/upgrade_log.txt
if [ -x /tmp/$1/tmp/post_upgrade_command.php ]; then
echo "Running /tmp/$1/tmp/post_upgrade_command.php $1" >> /conf/upgrade_log.txt
/tmp/$1/tmp/post_upgrade_command.php $1 >> /conf/upgrade_log.txt 2>&1
elif [ -f /tmp/post_upgrade_command.php ]; then
echo "Running /tmp/post_upgrade_command.php $1" >> /conf/upgrade_log.txt
/tmp/post_upgrade_command.php $1
fi
# Remove any previous MD5 sum files
rm -f /root/*.md5
# File moved to pfSense php shell (pfSsh.php)
rm -rf /usr/local/sbin/cvs_sync.sh
# Fixup permissions on installed files
if [ "${PFSENSETYPE}" = "nanobsd" ]; then
MTREECHKDIR=/tmp/${1}/
else
MTREECHKDIR=/
fi
if [ -f ${MTREECHKDIR}etc/installed_filesystem.mtree ]; then
/usr/sbin/mtree -U -e -q -f ${MTREECHKDIR}etc/installed_filesystem.mtree -p ${MTREECHKDIR} > /conf/mtree.log;
fi;
# Make sure to preserve existing time zone
if [ "${PFSENSETYPE}" = "nanobsd" ] && [ -f /etc/localtime ]; then
/bin/cp -p /etc/localtime /tmp/${1}/etc/localtime 2>/dev/null
fi
#!/usr/local/bin/php -f
<?php
/* upgrade embedded users serial console */
require_once("globals.inc");
require_once("config.inc");
require_once("functions.inc");
if(file_exists("/usr/local/bin/git") && isset($config['system']['gitsync']['synconupgrade'])) {
if(!empty($config['system']['gitsync']['repositoryurl']))
exec("cd /root/pfsense/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url " . escapeshellarg($config['system']['gitsync']['repositoryurl']));
if(!empty($config['system']['gitsync']['branch']))
system("pfSsh.php playback gitsync " . escapeshellarg($config['system']['gitsync']['branch']) . " --upgrading");
}
$newslicedir = "";
if ($argv[1] != "")
$newslicedir = '/tmp/' . $argv[1];
if($g['enableserial_force'] || file_exists("{$newslicedir}/enableserial_force")) {
$config['system']['enableserial'] = true;
write_config();
}
system("echo \"Adding serial port settings ({$newslicedir})...\" >> /conf/upgrade_log.txt");
setup_serial_port("upgrade", $newslicedir);
#!/bin/sh
/usr/local/etc/rc.conf_mount_rw
# Record the previous version
PRIOR_VERSION=`uname -r | cut -d'.' -f1`
echo $PRIOR_VERSION > /tmp/pre_upgrade_version
# Hack to workaround ticket #3749
if [ "${PRIOR_VERSION}" = "8" ] && grep -q 'sh /usr/local/etc/rc.reboot' /usr/local/etc/rc.firmware; then
PROC=$(ps axwww | grep '/usr/local/etc/rc.firmware *pfSenseupgrade')
PID=''
IMG=''
if [ -n "${PROC}" ]; then
PID=$(echo "${PROC}" | awk '{print $1}')
IMG=$(echo "${PROC}" | sed 's,^.*pfSenseupgrade *,,')
fi
if [ -n "${PID}" -a -n "${IMG}" -a -f "${IMG}" ]; then
cp -fp /bin/sh /tmp/sh.old
kill ${PID} >/dev/null 2>&1
kill -9 ${PID} >/dev/null 2>&1
sed -i '' -e 's,sh /,/tmp/sh.old /,' /usr/local/etc/rc.firmware
/usr/local/etc/rc.firmware pfSenseupgrade "${IMG}"
exit
fi
fi
rm /boot/kernel/*
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment