Matheus Sampaio Queiroga
9045c3bedb
All checks were successful
/ build (386) (push) Successful in 7m22s
/ build (amd64) (push) Successful in 7m30s
/ build (arm) (push) Successful in 7m17s
/ build (arm64) (push) Successful in 7m17s
/ build (loong64) (push) Successful in 7m15s
/ build (mips) (push) Successful in 7m21s
/ build (mips64) (push) Successful in 7m8s
/ build (mips64le) (push) Successful in 6m29s
/ build (mipsle) (push) Successful in 4m47s
/ build (ppc64) (push) Successful in 4m49s
/ build (ppc64le) (push) Successful in 4m49s
/ build (riscv64) (push) Successful in 4m54s
/ build (s390x) (push) Successful in 4m47s
/ release (push) Successful in 24s
Signed-off-by: Matheus Sampaio Queiroga <srherobrine20@gmail.com>
28 lines
958 B
Bash
Executable File
28 lines
958 B
Bash
Executable File
#!/usr/bin/env bash
|
|
service_exists() {
|
|
local n=$1
|
|
if [[ $(systemctl list-units --all -t service --full --no-legend "$n.service" | sed 's/^\s*//g' | cut -f1 -d' ') == $n.service ]]; then
|
|
return 0
|
|
else
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
if ! [[ -f "/etc/etc_runner/config_base.yaml" ]]; then
|
|
echo "Copying base configuration to /etc/etc_runner/config.yaml"
|
|
cp -v /etc/etc_runner/config_base.yaml /etc/etc_runner/config.yaml
|
|
fi
|
|
|
|
# Start service
|
|
if command -v systemctl &> /dev/null; then
|
|
echo "Restarting/starting act_runner service"
|
|
systemctl daemon-reload || echo "Systemctl not loaded"
|
|
if service_exists act_runner; then
|
|
systemctl enable act_runner.service || echo Act runner is enabled
|
|
systemctl restart act_runner.service || echo "Systemctl not loaded"
|
|
elif service_exists act-runner; then
|
|
systemctl enable act-runner.service || echo Act runner is enabled
|
|
systemctl restart act-runner.service || echo "Systemctl not loaded"
|
|
fi
|
|
fi
|