5

I am writing a Bash script for installing Asterisk. Instead of running the make menuselect command, which provides an interactive UI to select different options, I want to use the command menuselect/menuselect --enable ____ menuselect.makeopts to select required options for the build. But when I run the script, I get this error:

menuselect/menuselect: No such file or directory

How to run this command from a script?

miken32
  • 42,008
  • 16
  • 111
  • 154
User_890
  • 169
  • 1
  • 9

1 Answers1

8

You need to do a preliminary build with make menuselect.makeopts before you can run menuselect. Here's what a portion of my build script looks like:

pushd /usr/local/src/asterisk-13.5.0/
./configure --libdir=/usr/lib64 --without-dahdi --without-pri --without-gtk2 \
    --without-radius --without-x11 --without-speex --with-pjproject-bundled
make menuselect.makeopts
menuselect/menuselect \
    --disable-category MENUSELECT_ADDONS \
    --disable-category MENUSELECT_APPS \
        --enable app_authenticate --enable app_cdr --enable app_celgenuserevent \
        --enable app_channelredirect --enable app_chanisavail --enable app_chanspy \
...
make
make install WGET_EXTRA_ARGS="--no-verbose"
make config
popd
miken32
  • 42,008
  • 16
  • 111
  • 154
  • how to go with default options?... @mikenn32 – Akhil Jan 28 '20 at 08:48
  • No idea. Maybe just don't run `menuselect/menuselect` at all? – miken32 Jan 28 '20 at 14:41
  • yes... that's right ```make menuselect.makeopts``` will keep default opts.useful for non-interactive shell scripting @miken32 – Akhil Jan 28 '20 at 16:38
  • Just not do make menuselect if you need default option. That step is not needed. You need only configure&make install if you not gooing change anything. – arheops Jan 30 '20 at 01:13