Environment/Variables unset after reboot

Hi,
I installed the openziti (without GUI) via express install. But whenever I reboot the system the variable unset.

For example below gives blank output
echo ${ZITI_CTRL_EDGE_ADVERTISED_ADDRESS}:${ZITI_CTRL_EDGE_ADVERTISED_PORT}
echo “${ZITI_BIN_DIR-}/ziti” edge list edge-routers
echo $ZITI_BIN_DIR

Kindly suggest a way to keep the variables intact even after reboot.

Thank you

hi @kashif, welcome to the forum and to OpenZiti!

When you reboot the system, if you want to make use of the environment variables you just need to source the file the quickstart leaves behind containing all these environment variables.

That file is almost always located at $HOME/.ziti/quickstart/$(hostname -s)/$(hostname -s).env

So just source $HOME/.ziti/quickstart/$(hostname -s)/$(hostname -s).env and you’ll be able to see those variables.

Thank you very much for the quick response, very appreciated.

Yes I sourced it. Before reboot i can start stop controller and router and can show output “${ZITI_BIN_DIR-}/ziti” edge list edge-routers, zitiLogin, …

After sourcing, this is the output

root@ub22:/home/sk# echo ${ZITI_CTRL_EDGE_ADVERTISED_ADDRESS}:${ZITI_CTRL_EDGE_ADVERTISED_PORT}
ub22:1280
root@ub22:/home/sk# startController
startController: command not found
root@ub22:/home/sk# startRouter
startRouter: command not found
root@ub22:/home/sk# /root/.ziti/quickstart/ub22/ziti-bin/ziti-v0.29.0/ziti edge list identities
RESTY 2023/08/07 13:10:58 ERROR Get "https://ub22:1280/edge/management/v1/identities": dial tcp IP:1280: connect: connection refused, Attempt 1
RESTY 2023/08/07 13:10:58 ERROR Get "https://ub22:1280/edge/management/v1/identities": dial tcp IP:1280: connect: connection refused, Attempt 2
error: unable to list entities at https://ub22:1280/edge/management/v1/identities in Ziti Controller at https://ub22:1280/edge/management/v1. Error: Get "https://ub22:1280/edge/management/v1/identities": dial tcp IP:1280: connect: connection refused
root@ub22:/home/sk# "${ZITI_BIN_DIR-}/ziti" edge list edge-routers
RESTY 2023/08/07 13:11:05 ERROR Get "https://ub22:1280/edge/management/v1/edge-routers": dial tcp IP:1280: connect: connection refused, Attempt 1
RESTY 2023/08/07 13:11:05 ERROR Get "https://ub22:1280/edge/management/v1/edge-routers": dial tcp IP:1280: connect: error: unable to list entities at https://ub22:1280/edge/management/v1/edge-routers in Ziti Controller at https://ub22:1280/edge/management/v1. Error: Get "https://ub22:1280/edge/management/v1/edge-routers": dial tcp IP:1280: connect: connection refused
root@ub22:/home/sk#
root@ub22:/home/sk# zitiLogin
[   0.001]    INFO ziti/ziti/cmd/helpers.StandardErrorMessage: Connection error: Get https://ub22:1280/.well-known/est/cacerts: dial tcp IP:1280: connect: connection refused
The connection to the server ub22:1280 was refused - did you specify the right host or port?

the startController/startRouter functions are delivered from the script you sourced to run expressInstall.

If you would like those functions, you can get them by running the same command you ran before, or you can pull the script down and cache it locally.

To run it as you do during expressInstall just run:

source /dev/stdin <<< "$(wget -qO- https://get.openziti.io/quick/ziti-cli-functions.sh)"

After sourcing the cli functions script, you’ll have startController/startRouter

Thank you very much.
Worked perfectly.
Bless you.