preload-daemon: ue pgrep to prevent 100% CPU issues with ps aux

pull/662/head
Botspot 4 years ago
parent 8be5077586
commit aaa24db333

@ -12,13 +12,13 @@ function error {
#variable 1 is yad or xlunch
#variable 2 is 'once', if you only want this to run once and exit.
if [ "$(ps aux | grep preload-daemon | grep -v grep | wc -l)" -gt 2 ];then
echo "Another instance of preload-daemon is already running. Exiting now."
if [ "$(pgrep preload-daemon | wc -l)" -gt 2 ];then
#echo "Another instance of preload-daemon is already running. Exiting now."
exit 0
fi
#generate list of folders to preload, including special folders
folders="$(cat ${DIRECTORY}/data/categories/structure | awk -F '|' '{print $2}' | sort | uniq | grep .)
folders="$(cat "${DIRECTORY}/data/categories/structure" | awk -F '|' '{print $2}' | sort | uniq | grep .)
Installed
All Apps"
#echo "$folders"

Loading…
Cancel
Save