2023-02-24 00:48:37 +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`
|
|
|
|
path=""
|
|
|
|
|
2023-10-28 03:57:28 +00:00
|
|
|
# NOTE: Remove if you want to pass file(s) besides directories...
|
2023-02-24 00:48:37 +00:00
|
|
|
if [[ ! "${1::1}" == /* ]]; then
|
|
|
|
path="${call_path}/${1}"
|
|
|
|
else
|
|
|
|
path="${1}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d "${path}" ]; then
|
|
|
|
echo "<change_me>: Path given not a directory..."
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-10-28 03:57:28 +00:00
|
|
|
# End NOTE: Remove if you want to pass file(s) besides directories...
|
|
|
|
|
|
|
|
# Collect abs paths and stuff in 'files' array
|
2023-10-28 05:52:33 +00:00
|
|
|
files=()
|
|
|
|
for f in "$@"; do
|
|
|
|
target=$(readlink -f "${f}")
|
|
|
|
i="${#files[@]}"
|
|
|
|
size=$(($i + 1))
|
|
|
|
files[$size]="${target}"
|
|
|
|
done
|
2023-02-24 00:48:37 +00:00
|
|
|
|
|
|
|
cd "/opt/"
|
|
|
|
python /opt/<change_me>.zip "$@"
|
|
|
|
}
|
2023-10-28 03:57:28 +00:00
|
|
|
main "$@";
|