Set repo origin on pull

In order to handle trove changes
This commit is contained in:
Bob Mottram 2016-01-27 10:53:03 +00:00
parent 12bbf03f5f
commit 5064ca9413
3 changed files with 52 additions and 29 deletions

View File

@ -556,15 +556,20 @@ function git_clone {
} }
function git_pull { function git_pull {
if [ ! $1 ]; then
echo $'git_pull no repo specified'
fi
git stash git stash
git remote set-url origin $1
git checkout master git checkout master
if [ "${FRIENDS_TROVE_SERVER}" ]; then if [ "${FRIENDS_TROVE_SERVER}" ]; then
if [ ${#FRIENDS_TROVE_SERVER} -gt 2 ]; then if [ ${#FRIENDS_TROVE_SERVER} -gt 2 ]; then
if [ "$FRIENDS_TROVE_PASSWORD" ]; then if [ "$FRIENDS_TROVE_PASSWORD" ]; then
if [ ${#FRIENDS_TROVE_PASSWORD} -gt 2 ]; then if [ ${#FRIENDS_TROVE_PASSWORD} -gt 2 ]; then
sshpass -p "$FRIENDS_TROVE_PASSWORD" git pull sshpass -p "$FRIENDS_TROVE_PASSWORD" git pull
if [ $1 ]; then if [ $2 ]; then
git checkout $1 -b $1 git checkout $2 -b $2
fi fi
return return
fi fi
@ -573,8 +578,8 @@ function git_pull {
fi fi
git pull git pull
if [ $1 ]; then if [ $2 ]; then
git checkout $1 -b $1 git checkout $2 -b $2
fi fi
} }
@ -1974,7 +1979,7 @@ function mesh_cjdns {
CURRENT_CJDNS_COMMIT=$(grep "cjdns commit" $COMPLETION_FILE | awk -F ':' '{print $2}') CURRENT_CJDNS_COMMIT=$(grep "cjdns commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$CURRENT_CJDNS_COMMIT" != "$CJDNS_COMMIT" ]]; then if [[ "$CURRENT_CJDNS_COMMIT" != "$CJDNS_COMMIT" ]]; then
cd /etc/cjdns cd /etc/cjdns
git_pull $CJDNS_COMMIT git_pull $CJDNS_REPO $CJDNS_COMMIT
sed -i "s/cjdns commit.*/cjdns commit:$CJDNS_COMMIT/g" $COMPLETION_FILE sed -i "s/cjdns commit.*/cjdns commit:$CJDNS_COMMIT/g" $COMPLETION_FILE
./do ./do
fi fi
@ -2026,7 +2031,7 @@ function mesh_cjdns {
useradd cjdns useradd cjdns
else else
cd /etc/cjdns cd /etc/cjdns
git_pull git_pull $CJDNS_REPO
./do ./do
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
exit 9926 exit 9926
@ -2309,7 +2314,7 @@ function install_zeronet_blog {
CURRENT_ZERONET_BLOG_COMMIT=$(grep "ZeroNet Blog commit" $COMPLETION_FILE | awk -F ':' '{print $2}') CURRENT_ZERONET_BLOG_COMMIT=$(grep "ZeroNet Blog commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$CURRENT_ZERONET_BLOG_COMMIT" != "$ZERONET_BLOG_COMMIT" ]]; then if [[ "$CURRENT_ZERONET_BLOG_COMMIT" != "$ZERONET_BLOG_COMMIT" ]]; then
cd /opt/zeronet/ZeroBlog cd /opt/zeronet/ZeroBlog
git_pull $ZERONET_BLOG_COMMIT git_pull $ZERONET_BLOG_REPO $ZERONET_BLOG_COMMIT
sed -i "s/ZeroNet Blog commit.*/ZeroNet Blog commit:$ZERONET_BLOG_COMMIT/g" $COMPLETION_FILE sed -i "s/ZeroNet Blog commit.*/ZeroNet Blog commit:$ZERONET_BLOG_COMMIT/g" $COMPLETION_FILE
fi fi
else else
@ -2432,7 +2437,7 @@ function install_zeronet_mail {
CURRENT_ZERONET_MAIL_COMMIT=$(grep "ZeroNet Mail commit" $COMPLETION_FILE | awk -F ':' '{print $2}') CURRENT_ZERONET_MAIL_COMMIT=$(grep "ZeroNet Mail commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$CURRENT_ZERONET_MAIL_COMMIT" != "$ZERONET_MAIL_COMMIT" ]]; then if [[ "$CURRENT_ZERONET_MAIL_COMMIT" != "$ZERONET_MAIL_COMMIT" ]]; then
cd /opt/zeronet/ZeroMail cd /opt/zeronet/ZeroMail
git_pull $ZERONET_MAIL_COMMIT git_pull $ZERONET_MAIL_REPO $ZERONET_MAIL_COMMIT
sed -i "s/ZeroNet Mail commit.*/ZeroNet Mail commit:$ZERONET_MAIL_COMMIT/g" $COMPLETION_FILE sed -i "s/ZeroNet Mail commit.*/ZeroNet Mail commit:$ZERONET_MAIL_COMMIT/g" $COMPLETION_FILE
fi fi
else else
@ -2556,7 +2561,7 @@ function install_zeronet_forum {
CURRENT_ZERONET_FORUM_COMMIT=$(grep "ZeroNet Forum commit" $COMPLETION_FILE | awk -F ':' '{print $2}') CURRENT_ZERONET_FORUM_COMMIT=$(grep "ZeroNet Forum commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$CURRENT_ZERONET_FORUM_COMMIT" != "$ZERONET_FORUM_COMMIT" ]]; then if [[ "$CURRENT_ZERONET_FORUM_COMMIT" != "$ZERONET_FORUM_COMMIT" ]]; then
cd /opt/zeronet/ZeroTalk cd /opt/zeronet/ZeroTalk
git_pull $ZERONET_FORUM_COMMIT git_pull $ZERONET_FORUM_REPO $ZERONET_FORUM_COMMIT
sed -i "s/ZeroNet Forum commit.*/ZeroNet Forum commit:$ZERONET_FORUM_COMMIT/g" $COMPLETION_FILE sed -i "s/ZeroNet Forum commit.*/ZeroNet Forum commit:$ZERONET_FORUM_COMMIT/g" $COMPLETION_FILE
fi fi
else else
@ -2674,7 +2679,7 @@ function install_zeronet {
CURRENT_ZERONET_COMMIT=$(grep "ZeroNet commit" $COMPLETION_FILE | awk -F ':' '{print $2}') CURRENT_ZERONET_COMMIT=$(grep "ZeroNet commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$CURRENT_ZERONET_COMMIT" != "$ZERONET_COMMIT" ]]; then if [[ "$CURRENT_ZERONET_COMMIT" != "$ZERONET_COMMIT" ]]; then
cd /opt/zeronet cd /opt/zeronet
git_pull $ZERONET_COMMIT git_pull $ZERONET_REPO $ZERONET_COMMIT
sed -i "s/ZeroNet commit.*/ZeroNet commit:$ZERONET_COMMIT/g" $COMPLETION_FILE sed -i "s/ZeroNet commit.*/ZeroNet commit:$ZERONET_COMMIT/g" $COMPLETION_FILE
systemctl restart zeronet.service systemctl restart zeronet.service
fi fi
@ -5280,7 +5285,7 @@ function encrypt_incoming_email {
CURRENT_GPGIT_COMMIT=$(grep "gpgit commit" $COMPLETION_FILE | awk -F ':' '{print $2}') CURRENT_GPGIT_COMMIT=$(grep "gpgit commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$CURRENT_GPGIT_COMMIT" != "$GPGIT_COMMIT" ]]; then if [[ "$CURRENT_GPGIT_COMMIT" != "$GPGIT_COMMIT" ]]; then
cd $INSTALL_DIR/gpgit cd $INSTALL_DIR/gpgit
git_pull $GPGIT_COMMIT git_pull $GPGIT_REPO $GPGIT_COMMIT
sed -i "s/gpgit commit.*/gpgit commit:$GPGIT_COMMIT/g" $COMPLETION_FILE sed -i "s/gpgit commit.*/gpgit commit:$GPGIT_COMMIT/g" $COMPLETION_FILE
cp gpgit.pl /usr/bin/gpgit.pl cp gpgit.pl /usr/bin/gpgit.pl
fi fi
@ -5592,7 +5597,7 @@ function email_archiving {
CURRENT_CLEANUP_MAILDIR_COMMIT=$(grep "cleanup-maildir commit" $COMPLETION_FILE | awk -F ':' '{print $2}') CURRENT_CLEANUP_MAILDIR_COMMIT=$(grep "cleanup-maildir commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$CURRENT_CLEANUP_MAILDIR_COMMIT" != "$CLEANUP_MAILDIR_COMMIT" ]]; then if [[ "$CURRENT_CLEANUP_MAILDIR_COMMIT" != "$CLEANUP_MAILDIR_COMMIT" ]]; then
cd $INSTALL_DIR/cleanup-maildir cd $INSTALL_DIR/cleanup-maildir
git_pull $CLEANUP_MAILDIR_COMMIT git_pull $CLEANUP_MAILDIR_REPO $CLEANUP_MAILDIR_COMMIT
sed -i "s/cleanup-maildir commit.*/cleanup-maildir commit:$CLEANUP_MAILDIR_COMMIT/g" $COMPLETION_FILE sed -i "s/cleanup-maildir commit.*/cleanup-maildir commit:$CLEANUP_MAILDIR_COMMIT/g" $COMPLETION_FILE
cp $INSTALL_DIR/cleanup-maildir/cleanup-maildir /usr/bin cp $INSTALL_DIR/cleanup-maildir/cleanup-maildir /usr/bin
fi fi
@ -5878,7 +5883,7 @@ function install_web_server {
CURRENT_NGINX_ENSITE_COMMIT=$(grep "Nginx-ensite commit" $COMPLETION_FILE | awk -F ':' '{print $2}') CURRENT_NGINX_ENSITE_COMMIT=$(grep "Nginx-ensite commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$CURRENT_NGINX_ENSITE_COMMIT" != "$NGINX_ENSITE_COMMIT" ]]; then if [[ "$CURRENT_NGINX_ENSITE_COMMIT" != "$NGINX_ENSITE_COMMIT" ]]; then
$INSTALL_DIR/nginx_ensite $INSTALL_DIR/nginx_ensite
git_pull $NGINX_ENSITE_COMMIT git_pull $NGINX_ENSITE_REPO $NGINX_ENSITE_COMMIT
sed -i "s/Nginx-ensite commit.*/Nginx-ensite commit:$NGINX_ENSITE_COMMIT/g" $COMPLETION_FILE sed -i "s/Nginx-ensite commit.*/Nginx-ensite commit:$NGINX_ENSITE_COMMIT/g" $COMPLETION_FILE
make install make install
fi fi
@ -6144,7 +6149,7 @@ function install_owncloud_music_app {
CURRENT_OWNCLOUD_MUSIC_APP_COMMIT=$(grep "Owncloud music app commit" $COMPLETION_FILE | awk -F ':' '{print $2}') CURRENT_OWNCLOUD_MUSIC_APP_COMMIT=$(grep "Owncloud music app commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$OWNCLOUD_MUSIC_APP_COMMIT" != "$OWNCLOUD_MUSIC_APP_COMMIT" ]]; then if [[ "$OWNCLOUD_MUSIC_APP_COMMIT" != "$OWNCLOUD_MUSIC_APP_COMMIT" ]]; then
cd /usr/share/owncloud/apps/music cd /usr/share/owncloud/apps/music
git_pull $OWNCLOUD_MUSIC_APP_COMMIT git_pull $OWNCLOUD_MUSIC_APP_REPO $OWNCLOUD_MUSIC_APP_COMMIT
sed -i "s/Owncloud music app commit.*/Owncloud music app commit:$OWNCLOUD_MUSIC_APP_COMMIT/g" $COMPLETION_FILE sed -i "s/Owncloud music app commit.*/Owncloud music app commit:$OWNCLOUD_MUSIC_APP_COMMIT/g" $COMPLETION_FILE
fi fi
else else
@ -6606,7 +6611,7 @@ function install_gogs {
CURRENT_GOGS_COMMIT=$(grep "Gogs commit" $COMPLETION_FILE | awk -F ':' '{print $2}') CURRENT_GOGS_COMMIT=$(grep "Gogs commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$CURRENT_GOGS_COMMIT" != "$GOGS_COMMIT" ]]; then if [[ "$CURRENT_GOGS_COMMIT" != "$GOGS_COMMIT" ]]; then
cd $GOPATH/src/github.com/gogits/gogs cd $GOPATH/src/github.com/gogits/gogs
git_pull $GOGS_COMMIT git_pull $GIT_DOMAIN_REPO $GOGS_COMMIT
sed -i "s/Gogs commit.*/Gogs commit:$GOGS_COMMIT/g" $COMPLETION_FILE sed -i "s/Gogs commit.*/Gogs commit:$GOGS_COMMIT/g" $COMPLETION_FILE
go get -u ./... go get -u ./...
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
@ -6941,7 +6946,7 @@ function install_tox_node {
CURRENT_TOX_COMMIT=$(grep "toxcore commit" $COMPLETION_FILE | awk -F ':' '{print $2}') CURRENT_TOX_COMMIT=$(grep "toxcore commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$CURRENT_TOX_COMMIT" != "$TOX_COMMIT" ]]; then if [[ "$CURRENT_TOX_COMMIT" != "$TOX_COMMIT" ]]; then
cd $INSTALL_DIR/toxcore cd $INSTALL_DIR/toxcore
git_pull $TOX_COMMIT git_pull $TOX_REPO $TOX_COMMIT
sed -i "s/toxcore commit.*/toxcore commit:$TOX_COMMIT/g" $COMPLETION_FILE sed -i "s/toxcore commit.*/toxcore commit:$TOX_COMMIT/g" $COMPLETION_FILE
autoreconf -i autoreconf -i
./configure --enable-daemon ./configure --enable-daemon
@ -7107,7 +7112,7 @@ function install_tox_client {
CURRENT_TOXIC_COMMIT=$(grep "Toxic commit" $COMPLETION_FILE | awk -F ':' '{print $2}') CURRENT_TOXIC_COMMIT=$(grep "Toxic commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$CURRENT_TOXIC_COMMIT" != "$TOXIC_COMMIT" ]]; then if [[ "$CURRENT_TOXIC_COMMIT" != "$TOXIC_COMMIT" ]]; then
cd $INSTALL_DIR/toxic cd $INSTALL_DIR/toxic
git_pull $TOXIC_COMMIT git_pull $TOXIC_REPO $TOXIC_COMMIT
sed -i "s/Toxic commit.*/Toxic commit:$TOXIC_COMMIT/g" $COMPLETION_FILE sed -i "s/Toxic commit.*/Toxic commit:$TOXIC_COMMIT/g" $COMPLETION_FILE
make make
make install make install
@ -7848,7 +7853,7 @@ function install_blog {
CURRENT_FULLBLOG_COMMIT=$(grep "Blog commit" $COMPLETION_FILE | awk -F ':' '{print $2}') CURRENT_FULLBLOG_COMMIT=$(grep "Blog commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$CURRENT_FULLBLOG_COMMIT" != "$FULLBLOG_COMMIT" ]]; then if [[ "$CURRENT_FULLBLOG_COMMIT" != "$FULLBLOG_COMMIT" ]]; then
cd /var/www/$FULLBLOG_DOMAIN_NAME/htdocs cd /var/www/$FULLBLOG_DOMAIN_NAME/htdocs
git_pull $FULLBLOG_COMMIT git_pull $FULLBLOG_REPO $FULLBLOG_COMMIT
sed -i "s/Blog commit.*/Blog commit:$FULLBLOG_COMMIT/g" $COMPLETION_FILE sed -i "s/Blog commit.*/Blog commit:$FULLBLOG_COMMIT/g" $COMPLETION_FILE
chown -R www-data:www-data /var/www/$FULLBLOG_DOMAIN_NAME/htdocs chown -R www-data:www-data /var/www/$FULLBLOG_DOMAIN_NAME/htdocs
fi fi
@ -8225,7 +8230,7 @@ function install_gnu_social {
CURRENT_GNUSOCIAL_COMMIT=$(grep "GNU Social commit" $COMPLETION_FILE | awk -F ':' '{print $2}') CURRENT_GNUSOCIAL_COMMIT=$(grep "GNU Social commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$CURRENT_GNUSOCIAL_COMMIT" != "$GNUSOCIAL_COMMIT" ]]; then if [[ "$CURRENT_GNUSOCIAL_COMMIT" != "$GNUSOCIAL_COMMIT" ]]; then
cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs
git_pull $GNUSOCIAL_COMMIT git_pull $MICROBLOG_REPO $GNUSOCIAL_COMMIT
sed -i "s/GNU Social commit.*/GNU Social commit:$GNUSOCIAL_COMMIT/g" $COMPLETION_FILE sed -i "s/GNU Social commit.*/GNU Social commit:$GNUSOCIAL_COMMIT/g" $COMPLETION_FILE
chown -R www-data:www-data /var/www/$MICROBLOG_DOMAIN_NAME/htdocs chown -R www-data:www-data /var/www/$MICROBLOG_DOMAIN_NAME/htdocs
fi fi
@ -8590,7 +8595,7 @@ function install_hubzilla {
CURRENT_HUBZILLA_COMMIT=$(grep "Hubzilla commit" $COMPLETION_FILE | awk -F ':' '{print $2}') CURRENT_HUBZILLA_COMMIT=$(grep "Hubzilla commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$CURRENT_HUBZILLA_COMMIT" != "$HUBZILLA_COMMIT" ]]; then if [[ "$CURRENT_HUBZILLA_COMMIT" != "$HUBZILLA_COMMIT" ]]; then
cd /var/www/$HUBZILLA_DOMAIN_NAME/htdocs cd /var/www/$HUBZILLA_DOMAIN_NAME/htdocs
git_pull $HUBZILLA_COMMIT git_pull $HUBZILLA_REPO $HUBZILLA_COMMIT
sed -i "s/Hubzilla commit.*/Hubzilla commit:$HUBZILLA_COMMIT/g" $COMPLETION_FILE sed -i "s/Hubzilla commit.*/Hubzilla commit:$HUBZILLA_COMMIT/g" $COMPLETION_FILE
chown -R www-data:www-data /var/www/$HUBZILLA_DOMAIN_NAME/htdocs chown -R www-data:www-data /var/www/$HUBZILLA_DOMAIN_NAME/htdocs
fi fi
@ -8601,7 +8606,7 @@ function install_hubzilla {
CURRENT_HUBZILLA_ADDONS_COMMIT=$(grep "Hubzilla addons commit" $COMPLETION_FILE | awk -F ':' '{print $2}') CURRENT_HUBZILLA_ADDONS_COMMIT=$(grep "Hubzilla addons commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$CURRENT_HUBZILLA_ADDONS_COMMIT" != "$HUBZILLA_ADDONS_COMMIT" ]]; then if [[ "$CURRENT_HUBZILLA_ADDONS_COMMIT" != "$HUBZILLA_ADDONS_COMMIT" ]]; then
cd /var/www/$HUBZILLA_DOMAIN_NAME/htdocs/addon cd /var/www/$HUBZILLA_DOMAIN_NAME/htdocs/addon
git_pull $HUBZILLA_ADDONS_COMMIT git_pull $HUBZILLA_ADDONS_REPO $HUBZILLA_ADDONS_COMMIT
sed -i "s/Hubzilla addons commit.*/Hubzilla addons commit:$HUBZILLA_ADDONS_COMMIT/g" $COMPLETION_FILE sed -i "s/Hubzilla addons commit.*/Hubzilla addons commit:$HUBZILLA_ADDONS_COMMIT/g" $COMPLETION_FILE
chown -R www-data:www-data /var/www/$HUBZILLA_DOMAIN_NAME/htdocs chown -R www-data:www-data /var/www/$HUBZILLA_DOMAIN_NAME/htdocs
fi fi
@ -9446,7 +9451,7 @@ function install_dynamicdns {
CURRENT_INADYN_COMMIT=$(grep "inadyn commit" $COMPLETION_FILE | awk -F ':' '{print $2}') CURRENT_INADYN_COMMIT=$(grep "inadyn commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$CURRENT_INADYN_COMMIT" != "$INADYN_COMMIT" ]]; then if [[ "$CURRENT_INADYN_COMMIT" != "$INADYN_COMMIT" ]]; then
cd $INSTALL_DIR/inadyn cd $INSTALL_DIR/inadyn
git_pull $INADYN_COMMIT git_pull $INADYN_REPO $INADYN_COMMIT
sed -i "s/inadyn commit.*/inadyn commit:$INADYN_COMMIT/g" $COMPLETION_FILE sed -i "s/inadyn commit.*/inadyn commit:$INADYN_COMMIT/g" $COMPLETION_FILE
./configure ./configure
USE_OPENSSL=1 make USE_OPENSSL=1 make
@ -9560,7 +9565,7 @@ function install_ipfs {
CURRENT_IPFS_COMMIT=$(grep "ipfs commit" $COMPLETION_FILE | awk -F ':' '{print $2}') CURRENT_IPFS_COMMIT=$(grep "ipfs commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$CURRENT_IPFS_COMMIT" != "$IPFS_COMMIT" ]]; then if [[ "$CURRENT_IPFS_COMMIT" != "$IPFS_COMMIT" ]]; then
cd /home/git/go/src/github.com/ipfs/go-ipfs cd /home/git/go/src/github.com/ipfs/go-ipfs
git_pull $IPFS_COMMIT git_pull $IPFS_REPO $IPFS_COMMIT
sed -i "s/ipfs commit.*/ipfs commit:$IPFS_COMMIT/g" $COMPLETION_FILE sed -i "s/ipfs commit.*/ipfs commit:$IPFS_COMMIT/g" $COMPLETION_FILE
chown -R git:git /home/git chown -R git:git /home/git
systemctl restart ipfs systemctl restart ipfs

View File

@ -113,15 +113,20 @@ function git_clone {
} }
function git_pull { function git_pull {
if [ ! $1 ]; then
echo $'git_pull no repo specified'
fi
git stash git stash
git remote set-url origin $1
git checkout master git checkout master
if [ "${FRIENDS_TROVE_SERVER}" ]; then if [ "${FRIENDS_TROVE_SERVER}" ]; then
if [ ${#FRIENDS_TROVE_SERVER} -gt 2 ]; then if [ ${#FRIENDS_TROVE_SERVER} -gt 2 ]; then
if [ "$FRIENDS_TROVE_PASSWORD" ]; then if [ "$FRIENDS_TROVE_PASSWORD" ]; then
if [ ${#FRIENDS_TROVE_PASSWORD} -gt 2 ]; then if [ ${#FRIENDS_TROVE_PASSWORD} -gt 2 ]; then
sshpass -p "$FRIENDS_TROVE_PASSWORD" git pull sshpass -p "$FRIENDS_TROVE_PASSWORD" git pull
if [ $1 ]; then if [ $2 ]; then
git checkout $1 -b $1 git checkout $2 -b $2
fi fi
return return
fi fi
@ -130,8 +135,8 @@ function git_pull {
fi fi
git pull git pull
if [ $1 ]; then if [ $2 ]; then
git checkout $1 -b $1 git checkout $2 -b $2
fi fi
} }
@ -274,7 +279,7 @@ function add_cert_letsencrypt {
fi fi
else else
cd ${INSTALL_DIR}/letsencrypt cd ${INSTALL_DIR}/letsencrypt
git_pull git_pull $LETSENCRYPT_REPO
fi fi
# stop the web server # stop the web server

View File

@ -100,18 +100,31 @@ function git_clone {
} }
function git_pull { function git_pull {
if [ ! $1 ]; then
echo $'git_pull no repo specified'
fi
git stash git stash
git remote set-url origin $1
git checkout master
if [ "${FRIENDS_TROVE_SERVER}" ]; then if [ "${FRIENDS_TROVE_SERVER}" ]; then
if [ ${#FRIENDS_TROVE_SERVER} -gt 2 ]; then if [ ${#FRIENDS_TROVE_SERVER} -gt 2 ]; then
if [ "$FRIENDS_TROVE_PASSWORD" ]; then if [ "$FRIENDS_TROVE_PASSWORD" ]; then
if [ ${#FRIENDS_TROVE_PASSWORD} -gt 2 ]; then if [ ${#FRIENDS_TROVE_PASSWORD} -gt 2 ]; then
sshpass -p "$FRIENDS_TROVE_PASSWORD" git pull sshpass -p "$FRIENDS_TROVE_PASSWORD" git pull
if [ $2 ]; then
git checkout $2 -b $2
fi
return return
fi fi
fi fi
fi fi
fi fi
git pull git pull
if [ $2 ]; then
git checkout $2 -b $2
fi
} }
if [ -f $CONFIGURATION_FILE ]; then if [ -f $CONFIGURATION_FILE ]; then
@ -132,7 +145,7 @@ fi
if [ -d $PROJECT_DIR ]; then if [ -d $PROJECT_DIR ]; then
if [ -f $CONFIGURATION_FILE ]; then if [ -f $CONFIGURATION_FILE ]; then
cd $PROJECT_DIR cd $PROJECT_DIR
git_pull git_pull $PROJECT_REPO
make install make install
${PROJECT_NAME} -c $CONFIGURATION_FILE ${PROJECT_NAME} -c $CONFIGURATION_FILE
fi fi