Add delay option in services.

This commit is contained in:
lemniskett 2021-01-13 00:09:27 +07:00
parent 7c376c8a5d
commit 4d45ab4858

View File

@ -37,8 +37,16 @@ case $1 in
mkdir -p $CHROOT/$i
rbind $i
done
msg "Starting services"
for j in ${SERVICES[@]}; do
chroot $CHROOT /bin/su -c "/usr/local/bin/archboxctl exec $j" > /dev/null 2>&1
if [[ $j = *:* ]]; then
delay=$(echo $j | sed 's/.*://')
service=$(echo $j | sed 's/:.*//')
chroot $CHROOT /bin/su -c "/usr/local/bin/archboxctl exec $service" > /dev/null 2>&1 &
sleep $delay
else
chroot $CHROOT /bin/su -c "/usr/local/bin/archboxctl exec $j" > /dev/null 2>&1 &
fi
done
exit 0
;;