PortValhalla/scripts/Common/Config/NVS/install.sh

21 lines
455 B
Bash
Raw Normal View History

2023-04-04 13:28:07 +00:00
#!/bin/bash
NVS_HOME="${NVS_HOME:-'$HOME/.nvs'}";
NVS_PATH="${NVS_PATH}";
2023-04-06 15:45:48 +00:00
bashProfile="/etc/bash.bashrc";
2023-04-04 13:28:07 +00:00
2023-04-06 15:45:48 +00:00
for profile in "$bashProfile" "/etc/fish/conf.d/nvs.fish" "/etc/zsh/zprofile"
do
if ! grep "\bNVS_HOME\b" "$profile"
then
{
echo "export NVS_HOME=\"$NVS_HOME\"";
echo 'source "'"$NVS_PATH"'/nvs.sh"';
2023-04-07 17:57:48 +00:00
} | sudo tee -a "$profile";
2023-04-06 15:45:48 +00:00
fi;
done;
2023-04-04 13:28:07 +00:00
2023-04-06 15:45:48 +00:00
source "$bashProfile";
2023-04-04 13:28:07 +00:00
nvs add latest;
nvs link latest;