From 0fe7460bd7480ac07be677cf27d53718ef24f002 Mon Sep 17 00:00:00 2001 From: Lisa Marie Maginnis Date: Sun, 28 Feb 2016 01:35:43 -0500 Subject: [PATCH] Removed create psql user, movoed to init.d style install, changed install script to set up isntall --- files/etc/init.d/install-mediagoblin/DEFAULT | 20 ++++++++++++++++++++ scripts/GMG/00_create_psql_user.sh | 8 -------- scripts/GMG/10_create_dir.sh | 4 +++- scripts/GMG/15_install_gmg.sh | 16 ++-------------- 4 files changed, 25 insertions(+), 23 deletions(-) create mode 100644 files/etc/init.d/install-mediagoblin/DEFAULT delete mode 100755 scripts/GMG/00_create_psql_user.sh diff --git a/files/etc/init.d/install-mediagoblin/DEFAULT b/files/etc/init.d/install-mediagoblin/DEFAULT new file mode 100644 index 0000000..dd7579e --- /dev/null +++ b/files/etc/init.d/install-mediagoblin/DEFAULT @@ -0,0 +1,20 @@ +#/bin/bash + +cd "${GMG_PATH}" +if [ ! -d mediagoblin ]; then + + # Create the GMG user + sudo -u postgres createuser -A -D mediagoblin + # Crea te GMG database + sudo -u postgres createdb -E UNICODE -O mediagoblin mediagoblin + + git clone git://git.savannah.gnu.org/mediagoblin.git -b stable + + cd mediagoblin + git submodule init && git submodule update + + ./bootstrap.sh && ./configure && make + mkdir user_dev && chmod 750 user_dev + ./bin/easy_install flup + +fi diff --git a/scripts/GMG/00_create_psql_user.sh b/scripts/GMG/00_create_psql_user.sh deleted file mode 100755 index e124317..0000000 --- a/scripts/GMG/00_create_psql_user.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# Create the GMG user -$ROOTCMD sudo -u postgres createuser -A -D mediagoblin -# Create GMG database -$ROOTCMD sudo -u postgres createdb -E UNICODE -O mediagoblin mediagoblin - - diff --git a/scripts/GMG/10_create_dir.sh b/scripts/GMG/10_create_dir.sh index 045d5c0..15a539d 100755 --- a/scripts/GMG/10_create_dir.sh +++ b/scripts/GMG/10_create_dir.sh @@ -1,4 +1,6 @@ #!/bin/bash -$ROOTCMD mkdir -p $GMG_PATH && $ROOTCMD chown -hR mediagoblin:www-data $GMG_PATH +if [ ! -d $GMG_PATH ]; then + $ROOTCMD mkdir -p $GMG_PATH && $ROOTCMD chown -hR mediagoblin:www-data $GMG_PATH +fi diff --git a/scripts/GMG/15_install_gmg.sh b/scripts/GMG/15_install_gmg.sh index fc60f11..ca3b008 100755 --- a/scripts/GMG/15_install_gmg.sh +++ b/scripts/GMG/15_install_gmg.sh @@ -1,17 +1,5 @@ #!/bin/bash - -cd $target/$GMG_PATH -if [ ! -d mediagoblin ]; then - - $ROOTCMD git clone git://git.savannah.gnu.org/mediagoblin.git -b stable - $ROOTCMD cd mediagoblin - $ROOTCMD git submodule init && $ROOTCMD git submodule update - - - $ROOTCMD ./bootstrap.sh && $ROOTCMD ./configure && $ROOTCMD make - $ROOTCMD mkdir user_dev && $ROOTCMD chmod 750 user_dev - $ROOTCMD ./bin/easy_install flup - -fi +fcopy -v /etc/init.d/ +$ROOTCMD update-rc.d mediagoblin defaults -- 2.25.1