我们可以运行 shell 脚本来检查系统 MAC 地址验证然后进行处理吗?
#!/bin/bash
### here i need to check system mac address
### if mac is not match then script will not run
killall gnome-terminal
echo "End Of Day Session Complete"
请提出建议
最佳答案
为什么不呢。首先获取系统的 mac 地址
,并将其存储在 shell 脚本或配置文件的变量中。每次运行脚本时,首先获取系统的mac地址
,并与已存储在脚本变量中的mac id进行比较,如果相同则继续,否则退出。使用 ifconfig -a
命令获取系统的 MAC 地址并将其存储在配置文件或脚本中。
关于linux - 使用 mac 地址验证运行 Shell 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49172457/