Skip to content

[Feature / Question] Access to exact raw args? #643

@mcblum

Description

@mcblum

Description

Hello again!

I'm working on implementing a small CLI to assist my family in configuring their Ubiquiti products so that they "just work". One of the quirks of this process is that sometimes you need to change the user's group when running a command when changing the config on the device. The process they suggest is to basically re-execute the command you just ran but with a different group. Doing a little investigation, it appears to me that Bashly has already processed some things about the command args even when initialize.sh runs - is that correct?

This is the code snippet that they recommend as the way to re-execute the command but with a different group:

if [ "$(id -g -n)" != 'vyattacfg' ] ; then
    exec sg vyattacfg -c "/bin/vbash $(readlink -f $0) $@"
fi

I can, of course, add some config to each command and re-construct the exact command that was run, but, before I do that, is there a way to access the raw args within the Bashly structure?

Thank you, the new features added recently are dope.
Matt

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions