This commit is contained in:
Bob Mottram 2016-09-28 17:25:02 +01:00
parent 1db99d4519
commit 1c619cc5ea
1 changed files with 26 additions and 28 deletions

View File

@ -120,31 +120,31 @@ function upgrade_gogs {
mkdir -p ${INSTALL_DIR}
fi
cd ${INSTALL_DIR}
if [ -f linux-${CURR_ARCH}.tar.gz ]; then
rm linux-${CURR_ARCH}.tar.gz
GOGS_FILE=linux_${CURR_ARCH}.tar.gz
if [ ! -f $GOGS_FILE ]; then
wget ${GOGS_BIN}
fi
if [ ! -f $GOGS_FILE ]; then
GOGS_FILE=linux_${CURR_ARCH}.zip
GOGS_BIN="https://github.com/gogits/gogs/releases/download/v${GOGS_VERSION}/${GOGS_FILE}"
if [ ! -f ${GOGS_FILE} ]; then
wget ${GOGS_BIN}
if [ ! -f linux_${CURR_ARCH}.tar.gz ]; then
GOGS_BIN="https://github.com/gogits/gogs/releases/download/v${GOGS_VERSION}/linux_${CURR_ARCH}.zip"
wget ${GOGS_BIN}
if [ ! -f linux_${CURR_ARCH}.zip ]; then
fi
if [ ! -f ${GOGS_FILE} ]; then
exit 37836
else
apt-get -y install unzip
unzip -A linux_${CURR_ARCH}.zip
unzip -A ${GOGS_FILE}
fi
else
tar -xzf ${INSTALL_DIR}/linux_${CURR_ARCH}.tar.gz
tar -xzf ${INSTALL_DIR}/${GOGS_FILE}
fi
if [ ! -d $INSTALL_DIR/gogs ]; then
exit 37823
fi
cp -r $INSTALL_DIR/gogs /home/$GOGS_USERNAME
if [ -f linux_${CURR_ARCH}.tar.gz ]; then
rm linux_${CURR_ARCH}.tar.gz
fi
if [ -f linux_${CURR_ARCH}.zip ]; then
rm linux_${CURR_ARCH}.zip
if [ -f ${GOGS_FILE} ]; then
rm ${GOGS_FILE}
fi
sed -i "s|Gogs version.*|Gogs version:$GOGS_VERSION|g" $COMPLETION_FILE
@ -351,31 +351,29 @@ function install_gogs {
mkdir -p ${INSTALL_DIR}
fi
cd ${INSTALL_DIR}
if [ -f linux-${CURR_ARCH}.tar.gz ]; then
rm linux-${CURR_ARCH}.tar.gz
GOGS_FILE=linux_${CURR_ARCH}.tar.gz
if [ ! -f ${GOGS_FILE} ]; then
wget ${GOGS_BIN}
fi
if [ ! -f ${GOGS_FILE} ]; then
GOGS_FILE=linux_${CURR_ARCH}.zip
GOGS_BIN="https://github.com/gogits/gogs/releases/download/v${GOGS_VERSION}/${GOGS_FILE}"
wget ${GOGS_BIN}
if [ ! -f linux_${CURR_ARCH}.tar.gz ]; then
GOGS_BIN="https://github.com/gogits/gogs/releases/download/v${GOGS_VERSION}/linux_${CURR_ARCH}.zip"
wget ${GOGS_BIN}
if [ ! -f linux_${CURR_ARCH}.zip ]; then
if [ ! -f ${GOGS_FILE} ]; then
exit 37836
else
apt-get -y install unzip
unzip -A linux_${CURR_ARCH}.zip
unzip -A ${GOGS_FILE}
fi
else
tar -xzf ${INSTALL_DIR}/linux_${CURR_ARCH}.tar.gz
tar -xzf ${INSTALL_DIR}/${GOGS_FILE}
fi
if [ ! -d $INSTALL_DIR/gogs ]; then
exit 37823
fi
cp -r $INSTALL_DIR/gogs /home/$GOGS_USERNAME
if [ -f linux_${CURR_ARCH}.tar.gz ]; then
rm linux_${CURR_ARCH}.tar.gz
fi
if [ -f linux_${CURR_ARCH}.zip ]; then
rm linux_${CURR_ARCH}.zip
if [ -f ${GOGS_FILE} ]; then
rm ${GOGS_FILE}
fi
if [ ! -f /home/$GOGS_USERNAME/gogs ]; then