#!/bin/bash set -e echo "Starting tgtd..." tgtd echo "Waiting for tgtd to be ready..." sleep 2 echo "Configuring targets from /etc/tgt/targets.conf..." tgt-admin -e echo "Verifying targets..." tgtadm --mode target --op show echo "tgtd is ready on port 3260" # Keep tgtd running in foreground while true; do sleep 10; done