add database setup and run script

This commit is contained in:
Fabian Posch 2025-01-24 17:47:26 +01:00
parent a76a91a948
commit 5c8c28255b
2 changed files with 29 additions and 0 deletions

View file

@ -8,3 +8,8 @@ export C_INCLUDE_PATH=$ACT_HOME/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=$ACT_HOME/include:$CPLUS_INCLUDE_PATH
echo ACT_HOME is set to $ACT_HOME
export ACT_DEPLOY_SERVER_ADDR=lab3
export ACT_DEPLOY_SERVER_USER=fault
export ACT_DEPLOY_SERVER_DBASE=act
export ACT_DEPLOY_SERVER_PORT=5432

24
run_agent.sh Normal file
View file

@ -0,0 +1,24 @@
#!/bin/bash
# Source the environment
source configure_environment.sh
# Check if password was configured
if [[ -z "${ACT_DEPLOY_SERVER_PWD}" ]]; then
echo -n "No password for database set. Please enter password: "
IFS= read -r line
echo -en "\n\nexport ACT_DEPLOY_SERVER_PWD=$line\n" >> configure_environment.sh
export ACT_DEPLOY_SERVER_PWD=$line
echo "Password set!"
fi
# Check if screen is installed
if command -v screen >/dev/null 2>&1; then
echo "Starting in screen session."
screen actsim-cluster-agent -j$(nproc)
else
echo "screen command not found. Starting in foreground."
actsim-cluster-agent -j$(nproc)
fi