mirror of
https://github.com/Kron4ek/Conty
synced 2024-11-16 19:50:06 +01:00
Add image_path variable
This commit is contained in:
parent
0d54828bf7
commit
0e87bc0fb4
1 changed files with 6 additions and 4 deletions
|
@ -10,6 +10,8 @@ script_dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
|||
squashfs_compressor="lz4"
|
||||
compressor_arguments="-Xhc"
|
||||
|
||||
image_path="${script_dir}"/image
|
||||
|
||||
# Set to true to use an existing squashfs image if it exists
|
||||
# Otherwise the script will always create a new image
|
||||
use_existing_image="false"
|
||||
|
@ -50,7 +52,7 @@ echo "Creating Conty..."
|
|||
echo
|
||||
|
||||
# Create the squashfs image
|
||||
if [ ! -f image ] || [ "${use_existing_image}" != "true" ]; then
|
||||
if [ ! -f "${image_path}" ] || [ "${use_existing_image}" != "true" ]; then
|
||||
if ! command -v mksquashfs 1>/dev/null; then
|
||||
echo "Please install squashfs-tools and run the script again"
|
||||
exit 1
|
||||
|
@ -62,12 +64,12 @@ if [ ! -f image ] || [ "${use_existing_image}" != "true" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
rm -f image
|
||||
mksquashfs "${bootstrap}" image -b 256K -comp ${squashfs_compressor} ${compressor_arguments}
|
||||
rm -f "${image_path}"
|
||||
mksquashfs "${bootstrap}" "${image_path}" -b 256K -comp ${squashfs_compressor} ${compressor_arguments}
|
||||
fi
|
||||
|
||||
# Combine the files into a single executable using cat
|
||||
cat conty-start.sh utils.tar image > conty.sh
|
||||
cat conty-start.sh utils.tar "${image_path}" > conty.sh
|
||||
chmod +x conty.sh
|
||||
|
||||
clear
|
||||
|
|
Loading…
Reference in a new issue