2016-04-04 13:59:26 +02:00
|
|
|
|
|
|
|
Plugin: fsx
|
|
|
|
Description::
|
|
|
|
Plugin which will make deeper look into directory structure using discovery
|
|
|
|
::
|
|
|
|
|
|
|
|
Version: 0.1
|
|
|
|
Url: https://raw.githubusercontent.com/limosek/zaf-plugins/master/fsx
|
|
|
|
Web: https://github.com/limosek/zaf-plugins/
|
|
|
|
Maintainer: Lukas Macura <lukas@macura.cz>
|
|
|
|
|
|
|
|
# Dependencies
|
|
|
|
Depends-dpkg: dash curl
|
|
|
|
Depens-opkg: busybox curl
|
|
|
|
Depends-rpm: curl
|
|
|
|
Depends-bin: curl find
|
|
|
|
|
|
|
|
Item discovery:
|
|
|
|
Description::
|
2016-04-04 14:48:57 +02:00
|
|
|
Discovery of files or directories. Enter % instead of * in mask.
|
2016-04-04 13:59:26 +02:00
|
|
|
::
|
2016-04-04 14:48:57 +02:00
|
|
|
Parameters: directory mask depth type
|
2016-04-04 13:59:26 +02:00
|
|
|
Type: string
|
|
|
|
Script::
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
. $ZAF_LIB_DIR/preload.sh
|
|
|
|
|
|
|
|
[ -z "$1" ] && zaf_err "Directory must be entered."
|
|
|
|
dir="$1"
|
2016-04-04 14:48:57 +02:00
|
|
|
mask="-name '$(echo $2|tr '%' '*')'"
|
|
|
|
depth="-maxdepth $3"
|
2016-04-04 13:59:26 +02:00
|
|
|
if [ -n "$4" ]; then
|
2016-04-04 14:48:57 +02:00
|
|
|
type="-type $4"
|
2016-04-04 13:59:26 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
eval find "$dir" $depth $type $mask | zaf_discovery '{#PATH}'
|
|
|
|
|
|
|
|
::
|
|
|
|
/Item
|
|
|
|
|
|
|
|
Item pathinfo_type:
|
|
|
|
Description::
|
|
|
|
Type of discovered path (d,f,l)
|
|
|
|
d - directory
|
|
|
|
f - file
|
|
|
|
l - symbolink link
|
|
|
|
::
|
|
|
|
Parameters: discovered_path
|
|
|
|
Type: character
|
|
|
|
Script::
|
|
|
|
|
|
|
|
. $ZAF_LIB_DIR/preload.sh
|
|
|
|
|
|
|
|
[ -z "$1" ] && zaf_err "Directory must be entered."
|
|
|
|
|
|
|
|
[ -f "$1" ] && echo f && exit
|
|
|
|
[ -d "$1" ] && echo d && exit
|
|
|
|
[ -l "$1" ] && echo l && exit
|
|
|
|
|
|
|
|
::
|
|
|
|
/Item:
|
|
|
|
|
|
|
|
Item pathinfo_du:
|
|
|
|
Description::
|
|
|
|
Disk usage of discovered path in bytes
|
|
|
|
::
|
|
|
|
Parameters: discovered_path
|
|
|
|
Type: integer
|
|
|
|
Script::
|
|
|
|
|
|
|
|
. $ZAF_LIB_DIR/preload.sh
|
|
|
|
|
|
|
|
[ -z "$1" ] && zaf_err "Directory must be entered."
|
|
|
|
|
|
|
|
du -sb "$1" | (read sum dir; echo $sum)
|
|
|
|
::
|
|
|
|
/Item:
|
|
|
|
|
|
|
|
Item pathinfo_items:
|
|
|
|
Description::
|
|
|
|
Number of items in discovered path (dirs+files+rest)
|
|
|
|
::
|
|
|
|
Parameters: discovered_path
|
|
|
|
Type: integer
|
|
|
|
Script::
|
|
|
|
|
|
|
|
. $ZAF_LIB_DIR/preload.sh
|
|
|
|
|
|
|
|
[ -z "$1" ] && zaf_err "Directory must be entered."
|
|
|
|
|
|
|
|
ls -1 "$1" |wc -l
|
|
|
|
::
|
|
|
|
/Item:
|
|
|
|
|
|
|
|
|