initial commit via gitinitshit

This commit is contained in:
2025-08-02 12:42:31 -06:00
commit f3b8d793a7
63 changed files with 2173 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
if [ -z $1 ]; then
echo -e "Usage:\n\tmonitor_pid \"MESSAGE\""
exit
fi
pid=$1
clear
echo -e "\nMonitoring for process PID $pid to end"
# get da webhook tag
tag=$(cat /usr/share/customscripts/tag.txt)
# infinite loop
while [ 1 -eq 1 ]; do
# check for da pid
ps -q $pid > /dev/null
ret=$?
# check if the process exists via retcode of the ps -q $pid
if [ $ret -ne 0 ]; then
webhook "Process $pid Ended at $(date)! \n\t$tag"
echo "Process $pid Ended at $(date)! \n\t$tag"
exit
fi
sleep 10
done