You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
548 B
20 lines
548 B
1 year ago
|
#!/usr/bin/env bash
|
||
1 year ago
|
#fixme This scripts is to stop the service
|
||
1 year ago
|
|
||
|
source ./style_info.cfg
|
||
|
source ./path_info.cfg
|
||
|
|
||
|
|
||
|
for i in ${service_names[*]}; do
|
||
|
#Check whether the service exists
|
||
|
name="ps -aux |grep -w $i |grep -v grep"
|
||
|
count="${name}| wc -l"
|
||
|
if [ $(eval ${count}) -gt 0 ]; then
|
||
|
pid="${name}| awk '{print \$2}'"
|
||
|
echo -e "${SKY_BLUE_PREFIX}Killing service:$i pid:$(eval $pid)${COLOR_SUFFIX}"
|
||
|
#kill the service that existed
|
||
|
kill -9 $(eval $pid)
|
||
|
echo -e "${SKY_BLUE_PREFIX}service:$i was killed ${COLOR_SUFFIX}"
|
||
|
fi
|
||
|
done
|