Thanks Samuraiii, On Thursday, 6 September 2018 08:48:31 BST Samuraiii wrote: > On 5.9.2018 21:20, Mick wrote:
> > I just noticed a psd error at boot time:
> >
> > /usr/bin/profile-sync-daemon: line 325: ${#DIRArr[@]##*/}: bad
> > substitution
> >
> > Any idea what's brought this about?
>
> Hi,
>
> my bet is that your /bin/sh != /bin/bash and
$ echo $SHELL
/bin/bash
$ ls -la /bin/sh
lrwxrwxrwx 1 root root 4 Jan 5 2018 /bin/sh -> bash
> /usr/bin/profile-sync-daemon starts with #!/bin/sh.
No, it starts with the bash shebang:
#!/bin/bash
#
# Profile-sync-deamon by graysky <graysky AT archlinux DOT us>
# Inspired by some code originally written by Colin Verot
#
> The other way around /usr/bin/profile-sync-daemon contains bashishms.
>
> You can try (as a test) to change #!/bin/sh for #!/bin/bash...
>
> S
It's soooo full of bashisms I wouldn't know where to start. The substitution
line with the error is shown below, but my regex-fu is not good enough to
troubleshoot it:
# browser is on system so check profiles
#
# check that the LAST DIRECTORY in the full path is unique
unique_count=$(echo ${DIRArr[@]##*/} | sed 's/ /\n/g' | sort | uniq | wc -l)
if [[ ${#DIRArr[@]##*/} -eq $unique_count ]]; then
return # no problems so do nothing
else
echo -e " ${RED}Error: ${NRM}${BLD}dup profile for ${GRN}$browser${NRM}$
{BLD} detected. See psd manpage, correct, and try again."${NRM}
I also noticed the startup script has not yet been converted to openrc-run:
# /etc/init.d/psd restart
* /etc/init.d/psd uses runscript, please convert to openrc-run.
* Starting Profile-Sync-Daemon ...
/usr/bin/profile-sync-daemon: line 325: ${#DIRArr[@]##*/}: bad substitution [
ok ]
--
Regards,
Mick
signature.asc
Description: This is a digitally signed message part.

