-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSmartInstallQT.sh
executable file
·48 lines (38 loc) · 2.12 KB
/
SmartInstallQT.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Colors
ORANGEBOLD='\033[1;33m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
# Contants
TEMP_FILE_PATH=/tmp/smartcash.tar.gz
TEMP_PATH=/tmp/smartcash-2.1.1
USER_FOLDER_NAME=SmartCash
DESKTOP_FILENAME=SmartCash.desktop
ICON_FILENAME=SmartCash.png
WALLET_URL="https://github.com/SmartCash/Core-Smart/releases/download/v2.1.1/smartcash-2.1.1-x86_64-linux-gnu.tar.gz"
ICON_URL="https://github.com/SmartCash/SmartInstall/blob/master/smartcash.png"
# Downloading the wallet
echo -e "${GREEN}Downloading the wallet"
wget -q --show-progress $WALLET_URL -O $TEMP_FILE_PATH
# Extract the files
echo -e "${GREEN}Extracting the files"
tar xzf $TEMP_FILE_PATH -C /tmp/
rsync -a $TEMP_PATH/ $HOME/$USER_FOLDER_NAME/
# Downloading SmartCash icon
echo -e "${GREEN}Downloading ${ORANGEBOLD}SmartCash ${GREEN}Icon PNG"
mkdir -p $HOME/.icons/
wget -q --show-progress $ICON_URL -O $HOME/.icons/$ICON_FILENAME.base64
base64 -d <<< "$(cat $HOME/.icons/$ICON_FILENAME.base64)" > ~/.icons/$ICON_FILENAME
echo -e "${GREEN}Removing the ${NC}base64 ${GREEN}icon file"
rm $HOME/.icons/$ICON_FILENAME.base64
# Create a shortcut on system
echo -e "${GREEN}Creating symbol link"
sudo ln -sf $HOME/$USER_FOLDER_NAME/bin/smartcash-qt /usr/bin/smartcash-qt
# Create location to store blocks and disable SAPI database.
mkdir ~/.smartcash
echo 'sapi=0' >> ~/.smartcash/smartcash.conf
# Create the .desktop current file
echo -e "${GREEN}Create the ${NC}.desktop ${GREEN}current file"
echo -e '[Desktop Entry]\nVersion=2.1.1\nName=SmartCash Desktop Wallet\nName[en_US]=SmartCash Desktop Wallet\nName[pt_BR]=Carteira Desktop SmartCash\nGenericName=SmartCash Wallet\nGenericName[en_US]=SmartCash Wallet\nGenericName[pt_BR]=Carteira SmartCash\nComment=Privacy Simplified\nComment[en_US]=Privacy Simplified\nComment[pt_BR]=Privacidade simplificada\nExec=smartcash-qt\nIcon=smartcash\nTerminal=false\nStartupWMClass=bitcoinc-qt\nStartupNotify=true\nType=Application\nCategories=Finance;Internet;Network;\nMimeType=x-scheme-handler/smartcash;' | tee ~/.local/share/applications/$DESKTOP_FILENAME
chmod +x ~/.local/share/applications/$DESKTOP_FILENAME
echo -e "${GREEN}Installation finish"