This procedure was tested with the Raspberry Pi 3, Raspberry Pi 2 and Raspberry Pi Model B+, OS Raspbian installed from NOOBS v1.3.4
mkdir /home/pi/juice4halt/bin/
sudo nano /etc/rc.local
/home/pi/juice4halt/bin/shutdown_script &
/home/pi/juice4halt/bin/shutdown
_script &
sudo chmod 755 shutdown_script