From af0f3a198e87556c1b2ba1e76eb1514d352e106f Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Wed, 6 Apr 2016 14:38:52 +0100 Subject: [PATCH] added network file --- Censis/network.txt | 2 ++ scripts/obrand_install.sh | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 Censis/network.txt diff --git a/Censis/network.txt b/Censis/network.txt new file mode 100644 index 0000000..a210ff7 --- /dev/null +++ b/Censis/network.txt @@ -0,0 +1,2 @@ +censis - Censis2016 +censis-IoT - CensisDemo2015 \ No newline at end of file diff --git a/scripts/obrand_install.sh b/scripts/obrand_install.sh index f863cfc..aa9a941 100755 --- a/scripts/obrand_install.sh +++ b/scripts/obrand_install.sh @@ -5,6 +5,8 @@ DEV="$HOME/dev" LIVE="$HOME/live" SWAP="/swapfile" DBSETUP="obrand-admin-server/dbrebuild.sh" +PKG_MANAGER=$( command -v yum || command -v apt-get ) || echo "Neither yum nor apt-get found" +PKG_DEVICE=$(basename $PKG_MANAGER) fancy_echo() { local fmt="$1"; shift @@ -16,11 +18,15 @@ fancy_echo() { fancy_echo "Installing Obrand Admin Server ..." ## Update initial packages -sudo apt-get -y -q --force-yes update -# sudo apt-get -y -q --force-yes upgrade -# install apps -sudo apt-get --assume-yes install build-essential git nginx htop screen wget curl postgresql postgresql-contrib +if [ $(basename $PKG_MANAGER) = "yum" ]; then + sudo yum --assumeyes upgrade + sudo yum --assumeyes install git make automake gcc gcc-c++ kernel-devel nginx htop screen wget curl postgresql postgresql-contrib +else + sudo apt-get -y -q --force-yes update + sudo apt-get -y -q --force-yes upgrade + sudo apt-get --assume-yes install build-essential git nginx htop screen wget curl postgresql postgresql-contrib +fi # set up and install swap file if [[ ! -f "$SWAP" ]]; then @@ -86,6 +92,7 @@ cd $DEV/obrand-admin-server echo Setting up Database server... sudo su - postgres -c "$DEV/$DBSETUP" +node dbconfig.js echo Copying... rsync -uav --exclude .git $DEV/obrand-admin-server/ $LIVE @@ -95,6 +102,8 @@ sudo fuser -k 80/tcp sudo wget https://dl.dropboxusercontent.com/u/233909/obrand/obrand.nginx -O /etc/nginx/sites-available/obrand && sudo ln -s /etc/nginx/sites-available/obrand /etc/nginx/sites-enabled/obrand +sudo rm /etc/nginx/sites-enabled/default + npm set progress=true sudo /etc/init.d/nginx restart