2020-11-18 07:59:11 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-12-08 11:12:51 +01:00
|
|
|
hasError=0
|
|
|
|
|
2022-12-07 19:11:37 +01:00
|
|
|
if [ -f "/etc/arch-release" ]; then
|
|
|
|
echo '! jaklis needs gcc python3-pip python3-setuptools libpq-dev python3-dev python3-wheel'
|
|
|
|
elif [ -f "/etc/lsb-release" ]; then # ubuntu
|
|
|
|
for i in gcc python3-pip python3-setuptools libpq-dev python3-dev python3-wheel; do
|
|
|
|
if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
|
|
|
|
[[ ! $j ]] && sudo apt update
|
|
|
|
sudo apt install -y $i
|
|
|
|
j=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2020-11-18 07:59:11 +01:00
|
|
|
|
2021-12-08 11:12:51 +01:00
|
|
|
pip3 install -r requirements.txt || hasError=1
|
2020-12-03 23:45:11 +01:00
|
|
|
chmod u+x jaklis.py
|
2021-12-08 11:12:51 +01:00
|
|
|
ln -sf $(realpath jaklis.py) /usr/local/bin/jaklis || hasError=1
|
|
|
|
|
|
|
|
if [[ hasError -eq 0 ]]; then
|
|
|
|
echo "Setup done. You can use 'jaklis' command, try it."
|
|
|
|
else
|
|
|
|
echo "An error has occurred"
|
|
|
|
fi
|