| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 | #!/bin/bash
#
# .---.                  .              .
# |                      |              |
# |--- .--. .-.  .-.  .-.|  .-. .--.--. |.-.  .-. .--.  .-.
# |    |   (.-' (.-' (   | (   )|  |  | |   )(   )|  | (.-'
# '    '     --'  --'  -' -  -' '  '   -' -'   -' '   -  --'
#
#                    Freedom in the Cloud
#
# Command to upgrade the system
# License
# =======
#
# Copyright (C) 2015-2016 Bob Mottram <bob@freedombone.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
PROJECT_NAME='freedombone'
PROJECT_DIR="$HOME/${PROJECT_NAME}"
# An optional configuration file which overrides some of these variables
CONFIGURATION_FILE="$HOME/${PROJECT_NAME}.cfg"
PROJECT_REPO="https://github.com/bashrc/${PROJECT_NAME}"
FRIENDS_MIRRORS_SERVER=
FRIENDS_MIRRORS_SSH_PORT=2222
FRIENDS_MIRRORS_PASSWORD=
MY_MIRRORS_PASSWORD=
UTILS_FILES=/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-*
for f in $UTILS_FILES
do
  source $f
done
read_config_param PROJECT_REPO
update-ca-certificates
read_repo_servers
${PROJECT_NAME}-mirrors
if [ ! -d $PROJECT_DIR ]; then
    # TODO after stockholm merge change this to git_clone
    git clone $PROJECT_REPO $PROJECT_DIR
fi
if [ -d $PROJECT_DIR ]; then
    if [ -f $CONFIGURATION_FILE ]; then
        cd $PROJECT_DIR
        rm -rf $PROJECT_DIR/locale/*
        git checkout stockholm
        # TODO after stockholm merge change this to git_pull
        git merge --abort
        git stash
        git pull $PROJECT_REPO
        make install
        ${PROJECT_NAME} -c $CONFIGURATION_FILE
    fi
fi
if [ -f /usr/bin/reset-tripwire ]; then
    echo '
' | reset-tripwire
fi
# deliberately there is no 'exit 0' here
 |