File: guest

package info (click to toggle)
auto-apt-proxy 17
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 192 kB
  • sloc: sh: 428; makefile: 11
file content (21 lines) | stat: -rwxr-xr-x 460 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

set -eu

# This script assumes that 1) it's running on a guest system, such as a
# container or VM and 2) there is a proxy running on the host system.

under_test=$(basename $0)
virt="$(systemd-detect-virt || true)"
if [ "${virt}" != "${under_test}" ]; then
  echo "I: virt is ${virt}, not ${under_test}. Skip" >&2
  exit 77
fi

proxy=$(auto-apt-proxy)
if [ -z "${proxy}" ]; then
  echo "E: proxy not found!" >&2
  exit 1
fi

echo "proxy: ${proxy}"