Restarting AirSonic After Reboot or Crash


  • airsonic (restart script update)
  • Jonathan Haack
  • Haack’s Networking
  • webmaster@haacksnetworking.org

//airsonic (restart script update)//


Have an AirSonic instance? If so, you need to reboot at times and/or it may crash. If so, here’s a simple script I run to monitor whether it is up or not, and start it if not and/or write a log entry (or exit) if it is!

#!/bin/sh
DATE=date +"%Y%m%d-%H:%M:%S"
if
ps -ef | grep "java -jar" > /home/sexa/Desktop/airsonic-tmp.log
tail -n -2 /home/sexa/Desktop/airsonic-tmp.log | grep "java -jar -Dserver.port=8081 /var/airsonic/airsonic.war"
then
echo "Arisonic was running at $DATE" >> /home/sexa/Desktop/airsonic-ok.log
else
export TERM='vt100'
su - airsonic <<SHT
        script
        screen -S airsonic bash -c "java -jar -Dserver.port=8081 /var/airsonic/airsonic.war; bash"
SHT
fi

Let’s GO! The AirSonic advanced github project. The Wiki I maintain on how I build my instance.

Haack’s Networking
10-15-22; 11:54pm

Leave a Reply

Your email address will not be published. Required fields are marked *

Close
JavaScript licenses