Skip to content

Commit

Permalink
Add command to install irgsh-cli for package-maintainer.
Browse files Browse the repository at this point in the history
  • Loading branch information
herpiko committed Nov 4, 2020
1 parent 5c37920 commit 90f120b
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This is still under heavy development, therefore you should not rely on this for

Patches, suggestions and comments are welcome!

## Install
## Complete installation


You need Docker, Redis and these packages,
Expand All @@ -23,6 +23,12 @@ Install all deps + released IRGSH with this command bellow,
curl -L -o- https://raw.githubusercontent.com/BlankOn/irgsh-go/master/install.sh | bash
```

## Package maintainer installation

```
curl -L -o- https://raw.githubusercontent.com/BlankOn/irgsh-go/master/install-cli.sh | bash
```

The command will install the irgsh binaries, default configuration and daemons. A spesial user named `irgsh` will also be added to your system.

## Components
Expand Down
47 changes: 47 additions & 0 deletions install-cli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env bash

DIST=$(cat /etc/*release | grep "^ID=" | cut -d '=' -f 2)

# Require sudo or root privilege
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
fi

TEMP_PATH=/tmp
DEV_INSTALL=0

apt update
apt install -y gnupg jq

if [ -f ./target/release.tar.gz ]; then
# For development/testing purpose
TEMP_PATH=$(pwd)/target
DEV_INSTALL=1
else
# Download and extract
DOWNLOAD_URL=$(curl -ksL "https://api.github.com/repos/BlankOn/irgsh-go/releases/latest" | jq -r ".assets[0].browser_download_url")
echo "Downloading ... "
echo "$DOWNLOAD_URL"
rm -f $TEMP_PATH/release.tar.gz && cd $TEMP_PATH && curl -L -f -o ./release.tar.gz $DOWNLOAD_URL
if test $? -gt 0; then
echo "Downloding [FAILED]"
exit 1
fi
echo "Downloding [OK]"
echo
fi

pushd $TEMP_PATH

echo "Extracting ... "
rm -rf irgsh-go && tar -xf release.tar.gz
echo "Extracting [OK]"
echo

echo "Installing files ... "
cp -v $TEMP_PATH/irgsh-go/usr/bin/irgsh-cli /usr/bin/irgsh-cli

popd >/dev/null

echo "Happy hacking!"

0 comments on commit 90f120b

Please sign in to comment.