Your script has several issues that need to be addressed:
In the line if (( $version < 9 )) then, you should add a semicolon before then to properly end the conditional statement. It should be if (( $version < 9 )); then.
In the line cd ~ && termux-fix-shebang /data/data/com.termux/files/home/android-ndk-r23c/toolchains/llvm/prebuilt/linux-aarch64/bin/, the termux-fix-shebang command should be followed by a specific file path, not . You may need to specify the exact file to fix, or use a loop to fix all files in the directory.
When setting environment variables, ~ represents the user's home directory and should be replaced with the full path. For example, change echo 'export ANDROID_NDK_HOME=~/android-ndk-r23c/' >> ~/../usr/etc/profile to echo 'export ANDROID_NDK_HOME=/data/data/com.termux/files/home/android-ndk-r23c/' >> ~/../usr/etc/profile.
When downloading files, you should check if the file already exists to avoid downloading it again. You can check if the file exists before downloading and skip the download if it does.
When installing Go and Fyne, you should check if the installation was successful and add environment variables after the installation is complete.
These are some of the issues I found in your script. You can make these corrections to ensure the script runs correctly.
Your script has several issues that need to be addressed:
In the line if (( $version < 9 )) then, you should add a semicolon before then to properly end the conditional statement. It should be if (( $version < 9 )); then.
In the line cd ~ && termux-fix-shebang /data/data/com.termux/files/home/android-ndk-r23c/toolchains/llvm/prebuilt/linux-aarch64/bin/, the termux-fix-shebang command should be followed by a specific file path, not . You may need to specify the exact file to fix, or use a loop to fix all files in the directory.
When setting environment variables, ~ represents the user's home directory and should be replaced with the full path. For example, change echo 'export ANDROID_NDK_HOME=~/android-ndk-r23c/' >> ~/../usr/etc/profile to echo 'export ANDROID_NDK_HOME=/data/data/com.termux/files/home/android-ndk-r23c/' >> ~/../usr/etc/profile.
When downloading files, you should check if the file already exists to avoid downloading it again. You can check if the file exists before downloading and skip the download if it does.
When installing Go and Fyne, you should check if the installation was successful and add environment variables after the installation is complete.
These are some of the issues I found in your script. You can make these corrections to ensure the script runs correctly.