#!/bin/bash

if [[ -v IS_RUNIT ]]; then
    exec 2>$LOG_DIR/mize
    exec 1>$LOG_DIR/mize
    exec /home/me/work/config/mize/target/debug/mize --config $CONFIG_DIR/hosts/main/mize.toml --secrets $SECRETS_DIR/mize-secrets.toml run
    exit 0
fi

exec /home/me/work/config/mize/target/debug/mize --config $CONFIG_DIR/hosts/main/mize.toml --secrets $SECRETS_DIR/mize-secrets.toml "$@"
