2023-03-18 04:17:38 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# . CONFIG.sh
|
|
|
|
|
|
|
|
# set -o xtrace ## To debug scripts
|
|
|
|
# set -o errexit ## To exit on error
|
|
|
|
# set -o errunset ## To exit if a variable is referenced but not set
|
|
|
|
|
|
|
|
|
|
|
|
function main() {
|
|
|
|
call_path=`pwd`
|
|
|
|
|
2023-10-28 05:50:06 +00:00
|
|
|
files=()
|
|
|
|
for f in "$@"; do
|
2024-01-30 04:11:14 +00:00
|
|
|
# ff=${f%:*}
|
|
|
|
# ii=${f#*:}
|
|
|
|
# target=$(readlink -f "${ff}")
|
|
|
|
|
2023-10-28 05:50:06 +00:00
|
|
|
target=$(readlink -f "${f}")
|
|
|
|
i="${#files[@]}"
|
|
|
|
size=$(($i + 1))
|
2024-01-30 04:11:14 +00:00
|
|
|
|
2023-10-28 05:50:06 +00:00
|
|
|
files[$size]="${target}"
|
2024-01-30 04:11:14 +00:00
|
|
|
|
|
|
|
# if [ -n "$ii" ]; then
|
|
|
|
# files[$size]="${target}:${ii}"
|
|
|
|
# else
|
|
|
|
# files[$size]="${target}${ii}"
|
|
|
|
# fi
|
2023-10-28 05:50:06 +00:00
|
|
|
done
|
2023-03-18 04:17:38 +00:00
|
|
|
|
2024-01-30 04:11:14 +00:00
|
|
|
echo "${files[@]}"
|
|
|
|
|
|
|
|
|
2023-03-18 04:17:38 +00:00
|
|
|
cd "/opt/"
|
2023-10-28 05:50:06 +00:00
|
|
|
python /opt/newton.zip "${files[@]}"
|
2023-03-18 04:17:38 +00:00
|
|
|
}
|
2024-01-30 04:11:14 +00:00
|
|
|
main "$@";
|