| Server IP : 45.94.215.241 / Your IP : 216.73.217.13 Web Server : Apache/2.4.66 (Ubuntu) System : Linux srv2937474766 7.0.0-28-generic #28-Ubuntu SMP PREEMPT_DYNAMIC Sun Jun 21 01:01:36 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.5.4 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /sbin/ |
Upload File : |
#!/bin/sh
SNAP_BIN="/snap/bin/${0##*/}"
# Skip one symlink resolution and handle `snap install --dangerous` that are
# missing the automatic `snap alias lxd.lxc lxc` alias.
[ "${SNAP_BIN}" = "/snap/bin/lxc" ] && SNAP_BIN="/snap/bin/lxd.lxc"
# Check if the requested binary and the LXD snap are missing
if [ ! -f "${SNAP_BIN}" ] && ! snap list lxd >/dev/null 2>&1; then
# If there is a terminal connected to stdin and stdout, ask for confirmation before
# installing the needed snap(s) as it might take a while.
if [ -t 0 ] && [ -t 1 ]; then
echo -n "Would you like to install LXD snap now (Y/n)? " >&2
read -r answer
if [ "${answer:-y}" != "y" ] && [ "${answer:-y}" != "Y" ]; then
exit 1
fi
fi
if [ ! -e "/run/lxd-installer.socket" ]; then
echo -n "Waiting for lxd-installer.socket to start" >&2
for _ in $(seq 10); do
sleep 1
[ -e "/run/lxd-installer.socket" ] && break
echo -n . >&2
done
echo " done" >&2
fi
if [ ! -w "/run/lxd-installer.socket" ]; then
echo "Unable to trigger the installation of the LXD snap." >&2
echo "Please make sure you're a member of the 'lxd' system group." >&2
exit 1
fi
echo "Installing LXD snap, please be patient." >&2
python3 -c 'import socket; s=socket.socket(socket.AF_UNIX); s.connect("/run/lxd-installer.socket"); s.send(b"x"); s.recv(1)' >&2
# Do not wait for the binary to show up if the snap installation failed.
if ! snap list lxd >/dev/null 2>&1; then
echo "Unable to trigger the installation of the LXD snap." >&2
exit 1
fi
for _ in $(seq 90); do
sleep 1
[ -x "${SNAP_BIN}" ] && break
done
fi
exec "$SNAP_BIN" "$@"