-
Notifications
You must be signed in to change notification settings - Fork 1
/
start.sh
37 lines (37 loc) · 913 Bytes
/
start.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
echo "Installing dependencies..."
pip3 install -r requirements.txt
if [ -d "database" ]
then
echo "Database folder found"
else
mkdir "database"
echo "Database folder created"
fi
if [ -d "dbbackup" ]
then
echo "Database backup folder found"
else
mkdir "dbbackup"
echo "Database backup folder created"
fi
if [ -f "dbbackup/teleBot.sqlite" ]
then
if [ -f "database/teleBot.sqlite" ]
then
rm "database/teleBot.sqlite"
fi
cp "dbbackup/teleBot.sqlite" "database/teleBot.sqlite"
echo "Backup Restored"
elif [ -f "database/teleBot.sqlite" ]
then
cp "database/teleBot.sqlite" "dbbackup/teleBot.sqlite"
echo "Present Database Backup completed"
fi
echo "initialising the bot..."
python pyFiles/CR_ALT.py
if [ -f "database/teleBot.sqlite" ]
then
rm "dbbackup/teleBot.sqlite"
fi
cp "database/teleBot.sqlite" "dbbackup/teleBot.sqlite"
echo "Database Backup completed"