shutdown.sh can't see anything strange..
Remove all the sudo commands from install.sh script..
You need to install rpi tools addon from libreelec repo..
I m not really good with python but try this it should work.. for shutdown.py
Code
#!/usr/bin/env python
import os
import signal
import sys
sys.path.append('/storage/.kodi/addons/virtual.rpi-tools/lib')
import RPi.GPIO as GPIO
import subprocess
GPIO.setmode(GPIO.BCM)
GPIO.setup(3, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.wait_for_edge(3, GPIO.FALLING)
subprocess.call(['shutdown', '-h', 'now'], shell=False)
Display More