generated from KENZO-404/Lynx-Userbot
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
exec.sh
37 lines (35 loc) · 1.15 KB
/
exec.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
#!/bin/bash
RUNDIR=${PWD}
BOTDIR=$(dirname $(realpath ${0}))
UNIXTIME=$(date +%s)
if [ -z ${1} ] || [ ${1} == "-x" ] ; then
cd ${BOTDIR}
. venv/bin/activate
python3 -m userbot
RETVAL=${?}
deactivate
cd ${RUNDIR}
exit $RETVAL
elif [ ${1} == "-d" ] || [ ${1} == "--daemonize" ] ; then
echo -e "I: Running silently in the background like a ninja..."
cd ${BOTDIR}
. venv/bin/activate
nohup python3 -m userbot >>${UNIXTIME}-lynxproject.log 2>&1 & echo "I: Userbot PID is ${!}"
deactivate
cd ${RUNDIR}
exit 0
elif [ ${1} == "-h" ] || [ ${1} == "--help" ] ; then
echo -e "Lynx-Userbot"
echo -e "Licensed under Raphielscape Public License"
echo -e "\nUsage:"
echo -e "[no arguments] || -x -- Run in the foreground, stdout is the logcat"
echo -e "--daemonize || -d -- Run in the background, logs will be saved in *-lynxproject.log"
exit 0
else
echo -e "Lynx-Userbot"
echo -e "Licensed under Raphielscape Public License"
echo -e "\nUsage:"
echo -e "[no arguments] || -x -- Run in the foreground, stdout is the logcat"
echo -e "--daemonize || -d -- Run in the background, logs will be saved in *-lynxproject.log"
exit 127
fi