Skip to content

Commit

Permalink
feat: rclone, obscure, rsync backup; fix
Browse files Browse the repository at this point in the history
  • Loading branch information
woniuzfb committed Apr 5, 2024
1 parent 35a78e3 commit 5612adb
Show file tree
Hide file tree
Showing 79 changed files with 7,328 additions and 2,260 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
- [参数详解](#参数详解)
- [举例](#举例)
- [Alist](#alist)
- [Rclone](#rclone)
- [Calibre](#calibre)
- [LianHuanHua](#lianhuanhua)
- [Dev](#dev)

Expand Down Expand Up @@ -257,6 +259,26 @@ wget https://woniuzfb.github.io/iptv/iptv.sh && bash iptv.sh
./debug ali
```

## Rclone

```bash
./debug rc
```

- remote
- mount
- serve
- sync

## Calibre

```bash
./debug cw
```

- calibre-web
- kcc

## LianHuanHua

```bash
Expand Down
22 changes: 21 additions & 1 deletion build
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ReplaceInclude()
echo "${2:-}if [ \"\$self\" == \"tv\" ] || [ \"\$self\" == \"iptv\" ]"
echo "${2:-}then"
ReplaceInclude src/tv " ${2:-}"
bins=(v2 x nx or pve arm ibm cf cx ali lhh)
bins=(v2 x nx or pve arm ibm cf cx ali lhh rc cw)
for bin in "${bins[@]}"
do
echo "${2:-}elif [ \"\$self\" == \"$bin\" ]"
Expand All @@ -31,11 +31,31 @@ ReplaceInclude()
replace_name="${replace_name#*/}"
done

local here=false here_tag=""
while IFS= read -r line
do
if [ "$here" = true ]
then
echo "$line"
if [ "$line" = "$here_tag" ]
then
here=false
fi
continue
elif [[ $line =~ ^([ ]*)cat([ ]) ]]
then
here=true
here_tag="${line#*<<}"
here_tag="${here_tag#"${here_tag%%[![:space:]]*}"}"
here_tag=${here_tag%% *}
here_tag=${here_tag#-}
fi
if [ -z "$line" ]
then
echo
elif [ "$here" = true ]
then
echo "$line"
elif [[ $line =~ ^([ ]*)Include\ ([^ ]+) ]]
then
ReplaceInclude ${BASH_REMATCH[2]} "${2:-}${BASH_REMATCH[1]}"
Expand Down
49 changes: 36 additions & 13 deletions core
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,42 @@ Trim()

JoinByChar()
{
local IFS="$1"
shift
echo "$*"
local IFS="$1"
shift
echo "$*"
}

JoinByString()
{
local separator="$1"
shift
local first="$1"
shift
printf "%s" "$first" "${@/#/$separator}"
local separator="$1"
shift
local first="$1"
shift
printf "%s" "$first" "${@/#/$separator}"
}

ToJsonArray()
{
local var=("$1"[@])
if [[ -z "${!var:-}" ]]
then
echo "[]"
return 0
fi
local arr=("${!var}")
local json_array=$(printf '%s\n' "${arr[@]}" | $JQ_FILE -R . | $JQ_FILE -s .)
echo $json_array
}

shopt -s extglob

EleInArray()
{
local ele="$1"
shift
local var=("$1"[@])
local arr=("${!var}")
[[ "$ele" == @($(JoinByChar '|' "${arr[@]//|/\\|}")) ]]
local ele="$1"
shift
local var=("$1"[@])
local arr=("${!var}")
[[ "$ele" == @($(JoinByChar '|' "${arr[@]//|/\\|}")) ]]
}

printf()
Expand Down Expand Up @@ -197,6 +210,16 @@ GetRandomMac()
echo $RANDOM|md5sum|sed 's/../&:/g'|cut -c 1-17
}

RemoveQuotes()
{
local text="${!1}"
if [[ "$text" =~ ^\"(.*)\"$ ]] || [[ "$text" =~ ^\'(.*)\'$ ]]
then
text="${BASH_REMATCH[1]}"
read -r ${1} <<< "$text"
fi
}

PrepTerm()
{
unset term_child_pid
Expand Down
Loading

0 comments on commit 5612adb

Please sign in to comment.