Trouble adding to PATH using custom startup Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
firkinfedup
Posts: 2
Joined: Sat Jan 30, 2021 12:00 pm

Trouble adding to PATH using custom startup

Post by firkinfedup »

Hi there,

Sorry for the noob question. I'm trying to add to my PATH environment variable on startup, as well as set another variable. Unfortunately I'm not having much luck so presumably I'm going the wrong way about this..

1. I've enabled custom startup, dietpi-config > autostart options > 14 : Custom
2. I then added the following to custom.sh

echo "Setting up dotnet environment variables..."
export DOTNET_ROOT=/opt/dotnet
export PATH=$PATH:/opt/dotnet

echo "Starting amiberry service..."
service amiberry start

What happens is the system boots, amiberry start, without the last line it doesn't start, so I'm sure the script is doing "something". Unfortunately the environment variables do not get set. If I exit out of amiberry and type the 2 export commands manually, everything works as expected.

Any help would be greatly appreciated. Thanks.
firkinfedup
Posts: 2
Joined: Sat Jan 30, 2021 12:00 pm

Re: Trouble adding to PATH using custom startup

Post by firkinfedup »

I've found a solution, I changed my autostart back to amiberry fastboot and then added my environment variables to /etc/bash.bashrc
Post Reply