force python2 and correct stop script

This commit is contained in:
Mario Fetka 2023-01-07 19:54:28 +01:00
parent 467f826846
commit f47f9fcdf9
2 changed files with 6 additions and 6 deletions

View File

@ -14,7 +14,7 @@
MRC_PATH=@MYSTIC_DIR@
MRC_SERVER=mrc.bottomlessabyss.net
MRC_PORT=5000
MRC_PID=$(ps auxwww | grep "/usr/bin/python ./mrc_client.py" | grep -v grep | awk '{print $2}')
MRC_PID=$(ps auxwww | grep "/usr/bin/python2 ./mrc_client.py" | grep -v grep | awk '{print $2}')
echo "Attempting to start the Multi Relay Chat (MRC) python script.."
@ -27,12 +27,12 @@ fi
# Starting the MRC python script
cd $MRC_PATH >/dev/null
python2 mrc_client.py $MRC_SERVER $MRC_PORT &
/usr/bin/python2 ./mrc_client.py $MRC_SERVER $MRC_PORT &
cd - >/dev/null
# Wait 3 seconds and check for a PID
sleep 3
MRC_PID=$(ps auxwww | grep "/usr/bin/python ./mrc_client.py" | grep -v grep | awk '{print $2}')
MRC_PID=$(ps auxwww | grep "/usr/bin/python2 ./mrc_client.py" | grep -v grep | awk '{print $2}')
# Making sure it started successfully
if [ ! -z "$MRC_PID" ]

View File

@ -12,7 +12,7 @@
MRC_PATH=@MYSTIC_DIR@
MRC_SERVER=mrc.bottomlessabyss.net
MRC_PORT=5000
MRC_PID=$(ps auxwww | grep "/usr/bin/python ./mrc_client.py" | grep -v grep | awk '{print $2}')
MRC_PID=$(ps auxwww | grep "/usr/bin/python2 ./mrc_client.py" | grep -v grep | awk '{print $2}')
echo "Attempting to stop the Multi Relay Chat (MRC) python script.."
@ -33,7 +33,7 @@ echo "Checking to ensure the process stops.."
while [ $MRC_COUNTER -lt 6 ]
do
MRC_PID=$(ps auxwww | grep "/usr/bin/python ./mrc_client.py" | grep -v grep | awk '{print $2}')
MRC_PID=$(ps auxwww | grep "/usr/bin/python2 ./mrc_client.py" | grep -v grep | awk '{print $2}')
if [ ! -z "$MRC_PID" ]
then
echo "Process still running. Waiting 5 seconds.."
@ -54,7 +54,7 @@ fi
# Wait 5 seconds, then double check to ensure it stopped. Otherwise it's considered a failure.
sleep 5
MRC_PID=$(ps auxwww | grep "/usr/bin/python ./mrc_client.py" | grep -v grep | awk '{print $2}')
MRC_PID=$(ps auxwww | grep "/usr/bin/python2 ./mrc_client.py" | grep -v grep | awk '{print $2}')
if [ ! -z "$MRC_PID" ]
then
echo "Error: Failed to kill the mrc_client.py script."