确认Shell在Amazon Workspace上运行
我目前正在编写许多Shell脚本,这些脚本将在Amazon Workspaces Linux实例和其他Linux主机(例如Amazon Linux EC2实例)上运行。
我想根据是否在工作区实例上运行给定的脚本来使某些bash变量值以不同的方式配置。
鉴于此,我想知道是否有一种在操作系统级别检查主机是否是亚马逊工作区的方法?
I am currently writing a number of shell scripts which will run both on an Amazon Workspaces Linux instance and elsewhere on other Linux hosts (e.g. Amazon Linux EC2 instances).
I would like to have certain Bash variable values configured differently depending on whether or not a given script is being run on a WorkSpaces instance.
Given this, I was wondering if there is a way of checking at the OS level whether the host is an Amazon WorkSpace or not?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尽管可能没有失败证明,但一种识别Linux主机是否是Amazon Linux工作区主机之一的方法是寻找
/usr/usr/share/iCons/amazon-workspaces
目录的存在存储了Mate窗口管理器主题的图标资产。Although possibly not fail proof, one method of identifying whether a Linux host is one of the Amazon Linux WorkSpaces hosts is to look for the presence of the
/usr/share/icons/amazon-workspaces
directory where the icon assets for MATE window manager theme are stored.