generated from ArcAOGaming/arcao-process-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
26 lines (21 loc) · 777 Bytes
/
deploy.sh
File metadata and controls
26 lines (21 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# Get the current timestamp
current_timestamp=$(date +%Y%m%d%H%M%S)
# Define the deployment name
deployment_name="deployment$current_timestamp"
echo "Deployment Name: $deployment_name"
# Start AOS with a unique deployment name
{
aos $deployment_name &
sleep 15 # Wait for AOS to start
echo "" # Simulate pressing Enter
sleep 15 # Additional wait time
echo ".load process.lua"
sleep 2 # Wait before sending Ctrl+C
kill $! # Send SIGINT (Ctrl+C) to the background process
} | tee aos_output.log
# Extract and print the process ID using awk
process_id=$(awk '/Your AOS process:/ {print $4}' aos_output.log)
echo "Captured AOS Process ID: $process_id"
# Log the process ID to a .log file
echo "Process ID: $process_id" > process_id.log