OPNsense Forum

English Forums => Development and Code Review => Topic started by: Patrick M. Hausen on October 17, 2024, 08:20:28 PM

Title: How does the +TARGETS file in a plugin work?
Post by: Patrick M. Hausen on October 17, 2024, 08:20:28 PM
Hi all,

if I want to copy "distro" to "/usr/local/sbin/distro" like so:
distro:/usr/local/sbin/distro


is there a way to specify that the file should be installed mode 755?

Thanks!
Patrick
Title: Re: How does the +TARGETS file in a plugin work?
Post by: franco on October 17, 2024, 09:32:11 PM
I don't want to answer directly, so let me give you a question:

Do you need to template your binary (script)? If not you can put it in src/sbin/distro and chmod 755 in git which installs it directly into the directory.

If the script is templated try to make a config file to template and move the binary to src/sbin anyway. It's good practice.


Cheers,
Franco
Title: Re: How does the +TARGETS file in a plugin work?
Post by: Patrick M. Hausen on October 17, 2024, 09:37:48 PM
Quote from: franco on October 17, 2024, 09:32:11 PM
Do you need to template your binary (script)? If not you can put it in src/sbin/distro and chmod 755 in git which installs it directly into the directory.

Great! Thanks!