Is it possible to have a conditional within /etc/rc.local?
I've checked many Q&As and most people suggest running chmod +x on it, but my problem is different. It actually does work for me without conditionals, but doesn't otherwise.
#!/bin/sh
if [[ -e /usr/src/an-existing-file ]]
then
echo "seen" >> /etc/rclocalmadethis
fi
Here's the weird error I see when I run systemctl status rc-local.service:
rc.local[481]: /etc/rc.local: 3: /etc/rc.local: [[: not found
And here's my rc.local in the exact same location ls -lah /etc/:
-rwxr-xr-x 1 root root 292 Sep 19 09:13 rc.local
I'm on Debian 10 Standard.