Skip to content

Commit 317c7dc

Browse files
committed
Fix install
1 parent 205e5f9 commit 317c7dc

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ then
1717
elif [ -f /etc/os-release ]
1818
then
1919
source /etc/os-release
20-
if [ $NAME = "Ubuntu" ]
20+
if [ $NAME -eq "Ubuntu" ]
2121
then
2222
$SUDO_FLAG apt-get install curl jq -q=2
2323
else
@@ -51,7 +51,7 @@ then
5151
$SUDO_FLAG chmod +x $INSTALL_DIR/swiftbox
5252
fi
5353
SWIFTBOX_VERSION=`$INSTALL_DIR/swiftbox version`
54-
if [ $SWIFTBOX_VERSION = $LATEST_VERSION ]
54+
if [ $SWIFTBOX_VERSION -eq $LATEST_VERSION ]
5555
then
5656
echo "Already installed the latest version $SWIFTBOX_VERSION at $INSTALL_DIR. "
5757
exit

swiftbox.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
SWIFTBOX_VERSION="0.8.3"
3+
SWIFTBOX_VERSION="0.8.4"
44
INSTALL_DIR="/usr/bin"
55

66
if [ -f /etc/redhat-release ]
@@ -93,11 +93,11 @@ init-env() {
9393
case $SYSTEM_NAME in
9494
ubuntu)
9595
$SUDO_FLAG apt-get update -q=2
96-
$SUDO_FLAG apt-get install git libpython2.7 binutils tzdata libcurl4 libxml2 clang libicu-dev curl wget pkg-config zlib1g-dev libedit2 libsqlite3-0 -y
96+
$SUDO_FLAG apt-get install coreutils git libpython2.7 binutils tzdata libcurl4 libxml2 clang libicu-dev curl wget pkg-config zlib1g-dev libedit2 libsqlite3-0 -y
9797
;;
9898
centos)
9999
$SUDO_FLAG yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
100-
$SUDO_FLAG yum install --enablerepo=PowerTools curl wget binutils gcc git glibc-static libbsd-devel libedit libedit-devel libicu-devel libstdc++-static pkg-config python2 sqlite -y
100+
$SUDO_FLAG yum install --enablerepo=PowerTools coreutils curl wget binutils gcc git glibc-static libbsd-devel libedit libedit-devel libicu-devel libstdc++-static pkg-config python2 sqlite -y
101101
;;
102102
esac
103103
wget -q -O - https://swift.org/keys/all-keys.asc | $SUDO_FLAG gpg --import -
@@ -366,17 +366,17 @@ lookup)
366366
echo "Swift $NEW_VERSION is available for $SYSTEM_NICENAME $SYSTEM_VERSION"
367367
;;
368368
update)
369-
if [ $(cd `dirname $0`; pwd) != $(cd $INSTALL_DIR; pwd) ]
369+
if [ $(realpath `dirname $0`) != $(realpath $INSTALL_DIR) ]
370370
then
371371
echo "swiftbox is not installed to system, update is unavailable. "
372-
echo "You can install it with: $SUDO_FLAG $0 install"
372+
echo "You can install it with: $0 install"
373373
exit 254
374374
fi
375-
$SUDO_FLAG sh -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/stevapple/swiftbox@`get-latest`/install.sh)"
375+
sh -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/stevapple/swiftbox@`get-latest`/install.sh)"
376376
exit $?
377377
;;
378378
install)
379-
if [ $(cd `dirname $0`; pwd) = $(cd $INSTALL_DIR; pwd) ]
379+
if [ $(realpath `dirname $0`) = $(realpath $INSTALL_DIR) ]
380380
then
381381
echo "swiftbox is already installed to system. "
382382
exit 1

0 commit comments

Comments
 (0)