Solved Is there a simple way to install the pkg-tool noninteractively

I'm fairly new to FreeBSD.
I write a script to automate unattended installation.
I understand that right tool for this job is bsdinstall
Right now I write the setup-script for bsdinstall.
I test this script standalone, not with bsdinstall.

Since pkg is not installed yet, it wants interactive confirmation to bootstrap itself.
Can I get rid of this interactive confirmation easily?
I want to avoid expect, since it is not installed at this stage and
because I think there must be an easier way.
The FreeBSD Version is 10.1

my attempts sofar:
Code:
    pkg bootstrap
    pkg bootstrap -f
    yes | pkg bootstrap
    yes | pkg bootstrap -f
 
I had wrote to try pkg-static install -f pkg

But I tried it on a fresh install and it does not work before pkg is bootstrapped.
 
Back
Top