Upgrade script

This commit is contained in:
Bob Mottram 2014-10-10 21:25:58 +01:00
parent 3c30470fab
commit e48fae7ff8
3 changed files with 56 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 26 KiB

23
index.org Normal file
View File

@ -0,0 +1,23 @@
#+TITLE:
#+AUTHOR: Bob Mottram
#+EMAIL: bob@robotics.uk.to
#+KEYWORDS: freedombox, debian, beaglebone, red matrix, email, web server, home server, internet, censorship, surveillance, social network, irc, jabber
#+DESCRIPTION: Turn the Beaglebone Black into a personal communications server
#+OPTIONS: ^:nil
#+STYLE: <link rel="stylesheet" type="text/css" href="index.css" />
#+BEGIN_CENTER
[[./images/freedombone_logo.png]]
#+END_CENTER
* Introduction
* License
#+BEGIN_CENTER
Copyright (C) 2014 Bob Mottram
Permission is granted to copy, distribute and/or modify this document under the terms of the [[https://gnu.org/licenses/fdl.html][GNU Free Documentation License]], Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
Source for this web site in [[https://en.wikipedia.org/wiki/Org-mode][Emacs org-mode]] format is available [[/beaglebone.txt][here]]. Comments or patches may be submitted via [[https://github.com/bashrc/freedombone][Github]].
#+END_CENTER

View File

@ -228,6 +228,9 @@ USB_DRIVE=/dev/sda1
# Location where the USB drive is mounted to # Location where the USB drive is mounted to
USB_MOUNT=/mnt/usb USB_MOUNT=/mnt/usb
# name of a script used to upgrade the system
UPGRADE_SCRIPT_NAME="freedombone-upgrade"
# Name of a script used to create a backup of the system on usb drive # Name of a script used to create a backup of the system on usb drive
BACKUP_SCRIPT_NAME="backup" BACKUP_SCRIPT_NAME="backup"
@ -4501,6 +4504,35 @@ function install_mediagoblin {
echo 'install_mediagoblin' >> $COMPLETION_FILE echo 'install_mediagoblin' >> $COMPLETION_FILE
} }
function create_upgrade_script {
if grep -Fxq "create_upgrade_script" $COMPLETION_FILE; then
return
fi
echo '#!/bin/bash' > /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo '' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'apt-get -y update' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'apt-get -y --force-yes upgrade' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
if [ $REDMATRIX_DOMAIN_NAME ]; then
echo "cd /var/www/$REDMATRIX_DOMAIN_NAME/htdocs" >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'git stash' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'git stash drop' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'git pull' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo "cd /var/www/$REDMATRIX_DOMAIN_NAME/htdocs/addon" >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'git stash' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'git stash drop' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'git pull' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
fi
if [ $MICROBLOG_DOMAIN_NAME ]; then
echo "cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs" >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'git stash' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'git stash drop' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'git pull' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
fi
echo 'exit 0' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
chmod +x /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'create_upgrade_script' >> $COMPLETION_FILE
}
function install_final { function install_final {
if grep -Fxq "install_final" $COMPLETION_FILE; then if grep -Fxq "install_final" $COMPLETION_FILE; then
return return
@ -4549,6 +4581,7 @@ check_hwrng
search_for_attached_usb_drive search_for_attached_usb_drive
regenerate_ssh_keys regenerate_ssh_keys
script_to_make_self_signed_certificates script_to_make_self_signed_certificates
create_upgrade_script
configure_email configure_email
create_procmail create_procmail
#spam_filtering #spam_filtering