跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

07-etc-environment.sh

27 行 · 1.0 KB历史下载
1#!/bin/sh
2
3# SPDX-FileCopyrightText: Copyright The Lima Authors
4# SPDX-License-Identifier: Apache-2.0
5
6set -eux
7
8# /etc/environment must be written after 04-persistent-data-volume.sh has run to
9# make sure the changes on a restart are applied to the persisted version.
10
11orig=$(test ! -f /etc/environment || cat /etc/environment)
12if [ -e /etc/environment ]; then
13 sed -i '/#LIMA-START/,/#LIMA-END/d' /etc/environment
14fi
15cat "${LIMA_CIDATA_MNT}/etc_environment" >>/etc/environment
16
17# It is possible that a requirements script has started an ssh session before
18# /etc/environment was updated, so we need to kill it to make sure it will
19# restart with the updated environment before "linger" is being enabled.
20
21if command -v loginctl >/dev/null 2>&1 && [ "${orig}" != "$(cat /etc/environment)" ]; then
22 loginctl terminate-user "${LIMA_CIDATA_USER}" || true
23fi
24
25# Signal that provisioning is done. The instance ID changes on every boot,
26# so any value from a previous boot cycle will be different.
27echo "${LIMA_CIDATA_IID}" >/run/lima-ssh-ready