Tidying
This commit is contained in:
parent
1db99d4519
commit
1c619cc5ea
|
@ -120,31 +120,31 @@ function upgrade_gogs {
|
||||||
mkdir -p ${INSTALL_DIR}
|
mkdir -p ${INSTALL_DIR}
|
||||||
fi
|
fi
|
||||||
cd ${INSTALL_DIR}
|
cd ${INSTALL_DIR}
|
||||||
if [ -f linux-${CURR_ARCH}.tar.gz ]; then
|
GOGS_FILE=linux_${CURR_ARCH}.tar.gz
|
||||||
rm linux-${CURR_ARCH}.tar.gz
|
if [ ! -f $GOGS_FILE ]; then
|
||||||
|
wget ${GOGS_BIN}
|
||||||
fi
|
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}
|
wget ${GOGS_BIN}
|
||||||
if [ ! -f linux_${CURR_ARCH}.tar.gz ]; then
|
fi
|
||||||
GOGS_BIN="https://github.com/gogits/gogs/releases/download/v${GOGS_VERSION}/linux_${CURR_ARCH}.zip"
|
if [ ! -f ${GOGS_FILE} ]; then
|
||||||
wget ${GOGS_BIN}
|
|
||||||
if [ ! -f linux_${CURR_ARCH}.zip ]; then
|
|
||||||
exit 37836
|
exit 37836
|
||||||
else
|
else
|
||||||
apt-get -y install unzip
|
apt-get -y install unzip
|
||||||
unzip -A linux_${CURR_ARCH}.zip
|
unzip -A ${GOGS_FILE}
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
tar -xzf ${INSTALL_DIR}/linux_${CURR_ARCH}.tar.gz
|
tar -xzf ${INSTALL_DIR}/${GOGS_FILE}
|
||||||
fi
|
fi
|
||||||
if [ ! -d $INSTALL_DIR/gogs ]; then
|
if [ ! -d $INSTALL_DIR/gogs ]; then
|
||||||
exit 37823
|
exit 37823
|
||||||
fi
|
fi
|
||||||
cp -r $INSTALL_DIR/gogs /home/$GOGS_USERNAME
|
cp -r $INSTALL_DIR/gogs /home/$GOGS_USERNAME
|
||||||
if [ -f linux_${CURR_ARCH}.tar.gz ]; then
|
if [ -f ${GOGS_FILE} ]; then
|
||||||
rm linux_${CURR_ARCH}.tar.gz
|
rm ${GOGS_FILE}
|
||||||
fi
|
|
||||||
if [ -f linux_${CURR_ARCH}.zip ]; then
|
|
||||||
rm linux_${CURR_ARCH}.zip
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed -i "s|Gogs version.*|Gogs version:$GOGS_VERSION|g" $COMPLETION_FILE
|
sed -i "s|Gogs version.*|Gogs version:$GOGS_VERSION|g" $COMPLETION_FILE
|
||||||
|
@ -351,31 +351,29 @@ function install_gogs {
|
||||||
mkdir -p ${INSTALL_DIR}
|
mkdir -p ${INSTALL_DIR}
|
||||||
fi
|
fi
|
||||||
cd ${INSTALL_DIR}
|
cd ${INSTALL_DIR}
|
||||||
if [ -f linux-${CURR_ARCH}.tar.gz ]; then
|
GOGS_FILE=linux_${CURR_ARCH}.tar.gz
|
||||||
rm linux-${CURR_ARCH}.tar.gz
|
if [ ! -f ${GOGS_FILE} ]; then
|
||||||
|
wget ${GOGS_BIN}
|
||||||
fi
|
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}
|
wget ${GOGS_BIN}
|
||||||
if [ ! -f linux_${CURR_ARCH}.tar.gz ]; then
|
if [ ! -f ${GOGS_FILE} ]; 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
|
|
||||||
exit 37836
|
exit 37836
|
||||||
else
|
else
|
||||||
apt-get -y install unzip
|
apt-get -y install unzip
|
||||||
unzip -A linux_${CURR_ARCH}.zip
|
unzip -A ${GOGS_FILE}
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
tar -xzf ${INSTALL_DIR}/linux_${CURR_ARCH}.tar.gz
|
tar -xzf ${INSTALL_DIR}/${GOGS_FILE}
|
||||||
fi
|
fi
|
||||||
if [ ! -d $INSTALL_DIR/gogs ]; then
|
if [ ! -d $INSTALL_DIR/gogs ]; then
|
||||||
exit 37823
|
exit 37823
|
||||||
fi
|
fi
|
||||||
cp -r $INSTALL_DIR/gogs /home/$GOGS_USERNAME
|
cp -r $INSTALL_DIR/gogs /home/$GOGS_USERNAME
|
||||||
if [ -f linux_${CURR_ARCH}.tar.gz ]; then
|
if [ -f ${GOGS_FILE} ]; then
|
||||||
rm linux_${CURR_ARCH}.tar.gz
|
rm ${GOGS_FILE}
|
||||||
fi
|
|
||||||
if [ -f linux_${CURR_ARCH}.zip ]; then
|
|
||||||
rm linux_${CURR_ARCH}.zip
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f /home/$GOGS_USERNAME/gogs ]; then
|
if [ ! -f /home/$GOGS_USERNAME/gogs ]; then
|
||||||
|
|
Loading…
Reference in New Issue