-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
70 lines (69 loc) · 2.32 KB
/
setup.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
#
# Mr.Puitu - Powerful Telegram group managment bot
# Copyright (C) 2017 - 2019 Paul Larsen
# Copyright (C) 2019 - 2023 Nicky Lalrochhara
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
if [ "$EUID" -ne 0 ]
then echo "ERROR: Please run as root"
# exit
fi
echo "WARNING: THIS SCRIPT WILL CREATE A CONFIG FILE AND INSTALL ALL REQUIREMENTS; YOU STILL HAVE TO SETUP A DATABASE!"
# shellcheck disable=SC1068
BOOL=true
while $BOOL; do
read -p "QUESTION: Do you wish to install this program? [y/n] " yn
case $yn in
[Yy]* ) BOOL=false; break;;
[Nn]* ) exit;;
* ) echo "ERROR: Please answer yes or no.";;
esac
done
if [ -f /etc/os-release ]
then
if grep -q openSUSE "/etc/os-release"; then
echo "INFO: Running on openSUSE. Great!"
else
echo "ERROR: This script only supports openSUSE. Exiting."
exit
fi
else
echo "ERROR: /etc/os-release doesn't exist. Aborting."
exit
fi
RPM=$(rpm -q python38-base)
if echo "$RPM" | grep -q "not installed"; then
echo "INFO: Python is not installed on your system. Installing...";
zypper install --recommends --no-confirm python38-base
else
echo "INFO: Python 3 is installed on your system. Great!";
fi
RPM=$(rpm -q python3-pip)
if echo "$RPM" | grep -q "not installed"; then
echo "INFO: PIP3 is not installed on your system. Installing...";
zypper install --recommends --no-confirm python3-pip
else
echo "INFO: PIP3 is installed on your system. Great!";
fi
RPM=$(rpm -q gcc)
if echo "$RPM" | grep -q "not installed"; then
echo "INFO: GCC is not installed on your system. Installing...";
zypper install --recommends --no-confirm gcc
else
echo "INFO: GCC is installed on your system. Great!";
fi
echo "Installing requirements...."
pip3 install -r requirements.txt