qq2clone/gen_installer.bash

31 lines
702 B
Bash
Raw Normal View History

2021-07-14 05:41:59 +00:00
#!/bin/bash
# Generate an installer script using the most recent version of qq2clone
declare -a arc_files=( qq2clone lv_api_do qq2clone.1
qq2clone-completion.bash )
declare -a req_files=( "${arc_files[@]}" inst_fragment.bash )
2021-07-14 05:41:59 +00:00
has_req=1
for file in "${req_files[@]}"; do
if [[ ! -e "$file" ]]; then
has_req=0
echo "Current working directory missing file '$file'"
fi
done
((has_req)) || exit 1
2021-07-14 05:41:59 +00:00
echo "Generating script"
2021-07-14 05:41:59 +00:00
{
echo "#!/bin/bash"
2021-07-14 05:54:05 +00:00
echo
2021-07-14 05:41:59 +00:00
echo "# This script generated automatically by gen_installer.bash"
echo
echo "archive='"
tar -cz "${arc_files[@]}" | base64
2021-07-14 05:54:05 +00:00
echo "'"
echo
cat inst_fragment.bash
2021-07-14 05:41:59 +00:00
} > qq2clone_installer.bash
chmod +x qq2clone_installer.bash