Created
July 27, 2022 19:08
-
-
Save sidusnare/479513b86ee57ec25239b90cd93b1a9d to your computer and use it in GitHub Desktop.
Walk a daemontools directory and provide controls for them in a WindowMaker menu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo '"Services" MENU' | |
if [ ! -e "${HOME}/usr/local/service" ]; then | |
echo '"No service dir found" EXEC xterm -e ls -l "${HOME}/usr/local/services"' | |
echo '"Services" END' | |
exit 0 | |
fi | |
cd "${HOME}/usr/local/service" || exit 1 | |
for i in *;do | |
if [ ! -x "${i}/run" ]; then | |
continue | |
fi | |
echo -e " \"${i}\" MENU\n \"start\" EXEC svc -u \"${HOME}/usr/local/service/${i}\"\n \"stop\" EXEC svc -d \"${HOME}/usr/local/service/${i}\"\n \"HUP\" EXEC svc -h \"${HOME}/usr/local/service/${i}\"\n \"Kill\" EXEC svc -k \"${HOME}/usr/local/service/${i}\"\n \"restart\" EXEC svc.re.sh \"${HOME}/usr/local/service/${i}\"\n\"${i}\" END" | |
done | |
echo '"Services" END' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment