Trying to source aliases/shell scripts via init_command, however I cannot get it to load when the add on starts.
This path was chosen as it is not over-written when the add-on reboots like the .zhrc file seems to be ( I suspect as this file is reloaded with the add_on).
Manually running the command source /config/.shellstuff/scriptsandaliases will allow these aliases/scripts to run as expected.
Example of file to be sourced
# Preffered LS Readout
alias ll="ls -lah --color=auto"
# Script for ESPHome logs
el() {
docker exec -it addon_5c53de3b_esphome bash -c "esphome logs /config/esphome/$1"
}
Expected behavior
Add on starts, file is sourced, aliases and scripts are available via the CLI.
Actual behavior
Add on starts, commands are not available via CLI.
Log (Trace) Output:
Note: if the /config/.shellstuff/scriptsandaliases does not exist, it throws an error and won't start, so it seems to be able to access the file, its just not sourcing it.
Steps to reproduce
Create dir/file: /config/.shellstuff/scriptsandaliases
Input into file
# Preffered LS Readout
alias ll="ls -lah --color=auto"
# Script for ESPHome logs
el() {
docker exec -it addon_5c53de3b_esphome bash -c "esphome logs /config/esphome/$1"
}
Set init_command: source /config/.shellstuff/scriptsandaliases
Restart Add-On
Problem/Motivation
Trying to source aliases/shell scripts via init_command, however I cannot get it to load when the add on starts. This path was chosen as it is not over-written when the add-on reboots like the .zhrc file seems to be ( I suspect as this file is reloaded with the add_on).
Manually running the command
source /config/.shellstuff/scriptsandaliases
will allow these aliases/scripts to run as expected.Example of file to be sourced
Expected behavior
Add on starts, file is sourced, aliases and scripts are available via the CLI.
Actual behavior
Add on starts, commands are not available via CLI. Log (Trace) Output:
Note: if the
/config/.shellstuff/scriptsandaliases
does not exist, it throws an error and won't start, so it seems to be able to access the file, its just not sourcing it.Steps to reproduce
Create dir/file:
/config/.shellstuff/scriptsandaliases
Input into fileSet init_command:
source /config/.shellstuff/scriptsandaliases
Restart Add-OnProposed changes