markusressel / zfs-inplace-rebalancing

Simple bash script to rebalance pool data between all mirrors when adding vdevs to a pool.
Creative Commons Zero v1.0 Universal
303 stars 27 forks source link

Syntax Error with TrueNAS 13.0U6 #36

Closed CvW closed 3 months ago

CvW commented 6 months ago

If I try to execute this script in a standard GUI root shell, it fails with the following erorr:

/root/zfs-inplace-rebalancing.sh: 28: Syntax error: "(" unexpected

Is this expected? What can I do to mitigate the issue? Other .sh scripts here execute without issues. This version of TrueNAS runs on FreeBSD13.1 release p9.

markusressel commented 6 months ago

This script is expecting bash, the default shell on FreeBSD is zsh, which might not support the exact same syntax as bash. Probably even bash isn't identical on all platforms. Try running it using bash, otherwise the script will probably not work as is. Also see #35