[modify] change calibre_pids location to source code folder
This commit is contained in:
parent
aee4d3ca16
commit
1ab7a327ca
@ -1,14 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
calibre='/opt/apps/calibre/calibre-web-0.6.20'
|
calibre='/opt/apps/calibre/calibre-web-0.6.20'
|
||||||
# get the pid of calibre, and write it into file /tmp/calibre_pids
|
cd $calibre
|
||||||
ps -ef | grep "$calibre/cps.py" | grep -v grep | awk '{print $2}' > /tmp/calibre_pids
|
# get the pid of calibre, and write it into file calibre_pids
|
||||||
|
ps -ef | grep "$calibre/cps.py" | grep -v grep | awk '{print $2}' > calibre_pids
|
||||||
|
|
||||||
# if not exist, signifying that there is no calibre process
|
# if not exist, signifying that there is no calibre process
|
||||||
if [[ ! -s /tmp/calibre_pids ]]; then
|
if [[ ! -s calibre_pids ]]; then
|
||||||
echo -e "\e[1;31mCannot terminate Calibre process cause there is no such things, will run calibre later automatically.\e[0m"
|
echo -e "\e[1;31mCannot terminate Calibre process cause there is no such things, will run calibre later automatically.\e[0m"
|
||||||
else
|
else
|
||||||
for calibre_pid in `cat /tmp/calibre_pids`; do
|
for calibre_pid in `cat calibre_pids`; do
|
||||||
kill -9 $calibre_pid > /dev/null 2>&1
|
kill -9 $calibre_pid > /dev/null 2>&1
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user