Add -a flag to daemon maybe
This commit is contained in:
@@ -5,6 +5,17 @@
|
|||||||
SESSION="example"
|
SESSION="example"
|
||||||
echo "[main] SESSION: $SESSION"
|
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"
|
# Define commands: "workdir:::command" OR just "command"
|
||||||
CMDS=(
|
CMDS=(
|
||||||
"ping google.com"
|
"ping google.com"
|
||||||
@@ -100,3 +111,8 @@ EOF
|
|||||||
done
|
done
|
||||||
|
|
||||||
echo "[main] Done."
|
echo "[main] Done."
|
||||||
|
|
||||||
|
if [ $ATTACH_SESSION -eq 1 ]; then
|
||||||
|
echo "[main] Attaching to tmux session: $SESSION"
|
||||||
|
tmux attach -t $SESSION
|
||||||
|
fi
|
||||||
|
Reference in New Issue
Block a user