splitted main file, added rain, bump to v3.0.0

This commit is contained in:
2022-08-27 23:36:01 +02:00
parent 98afeed28d
commit 011e657e49
13 changed files with 1097 additions and 1104 deletions

40
profile.d/processes.sh Normal file
View File

@@ -0,0 +1,40 @@
# ------------------------------------------------------------------------------
# Search processes matching the given string
# ------------------------------------------------------------------------------
ppg ()
{
ps -edf | grep $@ | grep -v "grep $@"
}
export -f ppg
# ------------------------------------------------------------------------------
# Get PID list of the given process name
# ------------------------------------------------------------------------------
gpid ()
{
[[ $UID -eq 0 ]] && local psopt="-A"
[[ $# -eq 1 ]] && local single=1
for pid in $@; do
local result=$(ps $psopt | grep $pid | awk '{print $1}' | sed "s/\n/ /")
if [[ $single ]]; then
[[ $result ]] && echo "${result//$'\n'/ }"
else
[[ $result ]] && echo "$pid: ${result//$'\n'/ }"
fi
done
[[ $result ]] || return 1
}
export -f gpid
# ------------------------------------------------------------------------------
# Kill all processes owned by the given users
# ------------------------------------------------------------------------------
ku ()
{
for u in $@; do
killall -u $u
done
}
export -f ku