bish-bosh icon indicating copy to clipboard operation
bish-bosh copied to clipboard

bishbosh_publishFile fails on Busybox ash (openwrt)

Open fundef1 opened this issue 6 years ago • 0 comments

$2 doesn't get set which causes an unkown operand error and then: ./bish-bosh: ./lib/shellfire/core/init.functions: line 1: 2: parameter not set when calling dd in

bishbosh_connection_write_file()
     {
              dd if="$1" bs=$2 count=1
     }

root cause is bishbosh_filesize_ls() returning empty.

bishbosh_filesize_ls()
{
	# dateBitsAndFileName are not portable
	# permissions may have a '@' on the end if it is Mac OS X ls	
	local permissions links uid gid size dateBitsAndFileName

	IFS=' ' read -r <<-EOF
		$(ls -L -l -n "$1")
	EOF
}

workaround: use stat --filesize-algorithm GNUAndBusyBoxStat (or don't use dd )

fundef1 avatar May 01 '18 13:05 fundef1