简体   繁体   English

如何在Linux中创建自动运行文件并执行Shell文件?

[英]How to create a autorun file in linux and execute a shell file?

How to create a autorun file in linux which is similar to autorun.inf in Windows in order to execute a shell file ie Following are the requirment 如何在Linux中创建类似于Windows中的autorun.inf的自动运行文件以执行外壳文件,即以下是要求

1.Autorun the installer file ./example.sh 1.自动运行安装程序文件./example.sh

When CD is mounted onto the system . 将CD装入系统时。

this is not possible. 这是不可能的。 would be too much of a risk. 会有太大的风险。 You can of course do this for your own system in various variants. 当然,您可以为自己的系统提供各种变体。 for example cronjobs. 例如cronjobs。 but i suppose you want it to run on any other system... 但我想您希望它在任何其他系统上运行...

Linux安全性中的规则#1:任何新的可执行文件都必须在未经用户/所有者许可的情况下自行执行:)您可以为您的系统进行自动运行,但对于其他系统,我想

we might use our udev rules : 我们可以使用udev规则:

mount /mnt/flash && sh /mnt/flash/autorun.sh

with proper device signature (product id, device id). 具有正确的设备签名(产品ID,设备ID)。

or 要么

use "autorun" command, which currently works with cdrom. 使用“自动运行”命令,该命令当前可用于cdrom。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM