Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- TYPE="beta"
- if [ "$TYPE" = "beta" ]; then
- PKG_URL="https://management-beta.rehivetech.com/client"
- SERVER_URL="management-beta.rehivetech.com"
- else
- PKG_URL="https://www.pixla.online/client"
- SERVER_URL="backend.pixla.online"
- fi
- SYSTEM_ARCH=$(uname -m)
- TMP=$(basename "$0"| cut -d'-' -f 2-)
- TOKEN=$(echo "$TMP"| cut -d'.' -f 1)
- WORK_DIR="/tmp/pixla-client-install"
- if [ "$(id -u)" != "0" ]; then
- echo "This script must be launched with root privileges. Running sudo." 1>&2
- sudo "$0"
- exit 1
- fi
- if [ "$SYSTEM_ARCH" = "aarch64" ]; then
- PKG="pixla-client_armhf"
- elif [ "$SYSTEM_ARCH" = "armv7l" ]; then
- PKG="pixla-client_armhf"
- elif [ "$SYSTEM_ARCH" = "armv6l" ]; then
- PKG="pixla-client_armhf"
- elif [ "$SYSTEM_ARCH" = "x86_64" ]; then
- PKG="pixla-client_amd64"
- elif [ "$SYSTEM_ARCH" = "amd64" ]; then
- PKG="pixla-client_amd64"
- else
- echo "Your hardware is not supported. For more information contact us at info@rehivetech.com" 1>&2
- exit 1
- fi
- if ! [ -x "$(command -v wget)" ]; then
- echo "Error: wget is not installed." 1>&2
- exit 1
- fi
- mkdir -p /etc/pixla-client
- echo "$TOKEN" > /etc/pixla-client/token
- PKG_URL=$PKG_URL/$PKG
- rm -rf $WORK_DIR
- mkdir $WORK_DIR
- wget $PKG_URL -O $WORK_DIR/$PKG
- if [ $? -ne 0 ]; then
- echo "Pixla client could not be downloaded"
- exit 1
- fi
- chmod +x $WORK_DIR/$PKG
- cd $WORK_DIR && $WORK_DIR/$PKG
- if [ $? -ne 0 ]; then
- echo "Archive counld not be extracted"
- exit 1
- fi
- $WORK_DIR/setup.sh
- if [ $? -ne 0 ]; then
- echo "Pixla client could not be installed"
- exit 1
- fi
- if [ "$TYPE" = "beta" ]; then
- sed -i 's/backend.pixla.online/management-beta.rehivetech.com/g' /opt/pixla-client/gwtran.conf
- fi
- rm -rf $WORK_DIR
- echo "Installation was successful. Check your device at pixla.online"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement