MMCT TEAM
Server IP : 128.199.20.84  /  Your IP : 108.162.216.162
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux competent-maruti 5.4.0-128-generic #144-Ubuntu SMP Tue Sep 20 11:00:04 UTC 2022 x86_64
User : www-data ( 33)
PHP Version : 8.0.20
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0755) :  /var/lib/python/../python/../python/../python/../../lib/python/../../../snap/lxd/current/bin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /var/lib/python/../python/../python/../python/../../lib/python/../../../snap/lxd/current/bin/editor
#!/bin/sh
run_cmd() {
    CMD="$1"
    shift

    unset LD_LIBRARY_PATH
    export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    export HOME="${SNAP_REAL_HOME}"
    export USER="${USERNAME}"
    [ -z "${XDG_DATA_HOME:-}" ] && export XDG_DATA_HOME="${HOME}/.local/share/"
    [ -z "${XDG_CONFIG_HOME:-}" ] && export XDG_CONFIG_HOME="${HOME}/.config/"
    [ -z "${XDG_STATE_HOME:-}" ] && export XDG_STATE_HOME="${HOME}/.local/state/"

    # shellcheck disable=SC2145
    exec unshare --kill-child -U -m -p -r -f -R "/var/lib/snapd/hostfs/" "/bin/sh" -c "mount -t proc proc /proc 2>/dev/null || true; exec \"${CMD}\" \"$@\""
}

find_and_spawn() {
    for path in / /usr/ /usr/local/; do
        if [ -e "/var/lib/snapd/hostfs/${path}bin/${1}" ] || [ -L "/var/lib/snapd/hostfs/${path}bin/${1}" ]; then
            run_cmd "$@"
        fi
    done
}

EDIT_CMD="${1}"
EDIT_PATH="${2}"
if [ -z "${EDIT_PATH}" ] || [ "$#" -ge "3" ]; then
    EDIT_CMD=""
    for arg in "${@}"; do
        EDIT_PATH="${arg}"
    done
fi

# Try running the editor through the host.
if [ -n "${EDIT_CMD}" ]; then
    exec 9< /tmp/
    EDIT_PATH_HOST="$(echo "${EDIT_PATH}" | sed "s#/tmp/#/proc/self/fd/9/#g")"
    find_and_spawn "${EDIT_CMD}" "${EDIT_PATH_HOST}"
fi

# Default to built-in nano.
if [ -z "${EDIT_CMD}" ]; then
    EDIT_CMD="nano"
fi

# Setup for VIM.
if [ "$EDIT_CMD" != "nano" ]; then
    if [ -e "${SNAP_USER_COMMON}/.vimrc" ]; then
        export VIMINIT="source ${SNAP_USER_COMMON}/.vimrc"
    else
        export VIMINIT="source ${SNAP}/etc/vimrc"
    fi

    EDIT_CMD="vim.tiny"
fi

# Run the editor.
exec "${EDIT_CMD}" "${EDIT_PATH}"

MMCT - 2023