Add -a flag to daemon maybe

This commit is contained in:
2025-10-01 14:16:30 +02:00
parent 086ee5223c
commit ba4c36b397

View File

@@ -5,6 +5,17 @@
SESSION="example"
echo "[main] SESSION: $SESSION"
ATTACH_SESSION=0
while getopts "a" opt; do
case "$opt" in
a) ATTACH_SESSION=1 ;;
\?) echo "Usage: $0 [-a]" >&2
exit 1 ;;
esac
done
shift $((OPTIND-1))
# Define commands: "workdir:::command" OR just "command"
CMDS=(
"ping google.com"
@@ -100,3 +111,8 @@ EOF
done
echo "[main] Done."
if [ $ATTACH_SESSION -eq 1 ]; then
echo "[main] Attaching to tmux session: $SESSION"
tmux attach -t $SESSION
fi