OPNsense Forum

English Forums => 25.7, 25.10 Series => Topic started by: tessus on January 09, 2026, 12:48:08 AM

Title: choose shell for item 8 in /usr/local/sbin/opnsense-shell
Post by: tessus on January 09, 2026, 12:48:08 AM
In the /usr/local/sbin/opnsense-shell script that is used as the shell for the root user, the shell when selecting menu entry 8 is hard-coded to /bin/csh.

I would like to use bash (/usr/local/bin/bash) instead.

Can you please point me to the correct repo for this script so that I can submit a PR? I am thinking of reading a file (e.g. /etc/opnsense-shell) and in case the file exists and has a CMD_SHELL var, it will be used. Otherwise the current default is used. We can discuss the specifics in the PR.

What do you think?
Title: Re: choose shell for item 8 in /usr/local/sbin/opnsense-shell
Post by: meyergru on January 09, 2026, 08:58:27 AM
If at all, why not create a setting that is stored in config.xml and can be switched between bash, sh, tcsh and others?
Title: Re: choose shell for item 8 in /usr/local/sbin/opnsense-shell
Post by: tessus on January 09, 2026, 10:18:47 PM
Yes, this is a very nice idea. However, I am great with backend and scripts, but suck at anything with UI and/or frontend.

To answer your question: I don't know how to do that.
Title: Re: choose shell for item 8 in /usr/local/sbin/opnsense-shell
Post by: Patrick M. Hausen on January 09, 2026, 10:40:38 PM
How about adding to root's .cshrc something like e.g.

test -x /usr/local/bin/bash && exec /usr/local/bin/bash -l