![](/img/trans.png)
[英]How to use Static Ethernet ip and Wi-Fi at the same time in raspberry pi 3b+
[英]Is there any way to disable usb ports(Not ethernet ) on Raspberry pi 3b+?
我為 raspberry pi 編寫了一個腳本,我將我的腳本添加到 /etc/profile 並將我的腳本保存在 pi 主目錄中。 我的腳本就像一個循環,不應該被鍵盤或其他東西打斷。 做這個的最好方式是什么? 我應該添加一些行來阻止某人中斷我的腳本或禁用 USB 端口(不是以太網)嗎?
我嘗試過“TRAP”,但在多次按下 CTRL+C 后,它會從我的腳本中退出。
trap ' ' 2 3 6 15 INT TSTP
您可以使用stty
來啟用和禁用中斷鍵。
stty -isig # disable interrupt keys
# ... code that needs protecting
stty isig # enable interrupt keys
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.