Reply To: Ipod Share

#9300
w1ll14m
Participant

@rpedde wrote:

@blamm wrote:

Oh…

Can I use it?

Dang it… now I’m on the spot.

Would something like this work?

— check.bat —

if exist x:notes goto connected
goto notconnected

:connected
if exist c:connected.sem goto end
net start “firefly music server”
echo. > c:connected.sem
goto end

:notconnected
if exist c:notconnected.sem goto end
net stop “firefly music server”
echo. > c:notconnected.sem

:end
— check.bat —

— checker.bat —
:start
sleep 10
call check.bat
goto start
— checker.bat —

You’d have to change the drive letter for the ipod, but if you run the “checker.bat”, that should start and stop the service whenever the iPod is plugged in, right?

Cheesy, yeah…

i’m not shure if yours will work as it should, but this one will (i think) 🙂
runcheck.bat


@echo off
cls
set ipoddrive=NULL
set ipodconnected=0
set connectedsem=NULL
set notconnectedsem=NULL
set returnpath=normal
goto start

:start
if exist c:notes set ipoddrive=c
if exist d:notes set ipoddrive=d
if exist e:notes set ipoddrive=e
if exist f:notes set ipoddrive=f
if exist g:notes set ipoddrive=g
if exist h:notes set ipoddrive=h
if exist i:notes set ipoddrive=i
if exist j:notes set ipoddrive=j
if exist k:notes set ipoddrive=k
if exist l:notes set ipoddrive=l
if exist m:notes set ipoddrive=m
if exist n:notes set ipoddrive=n
if exist o:notes set ipoddrive=o
if exist p:notes set ipoddrive=p
if exist q:notes set ipoddrive=q
if exist r:notes set ipoddrive=r
if exist s:notes set ipoddrive=s
if exist t:notes set ipoddrive=t
if exist u:notes set ipoddrive=u
if exist v:notes set ipoddrive=v
if exist w:notes set ipoddrive=w
if exist x:notes set ipoddrive=x
if exist y:notes set ipoddrive=y
if exist z:notes set ipoddrive=z
goto check

:check
if exist c:connected.sem set connectedsem=found
if exist c:notconnected.sem set notconnectedsem=found
goto chstatus

:chstatus
if #%ipoddrive%# == #NULL# if #%connectedsem%# == #found# goto changetonotconnected
if not #%ipoddrive%# == #NULL# if #%notconnectedsem%# == #found# goto changetoconnected
if #%notconnectedsem%# == #NULL# if #%connectedsem%# == #NULL# goto firstrun
goto end

:firstrun
net stop "firefly music server"
echo. > c:notconnected.sem
set returnpath=firstrun
goto end

:changetoconnected
net start "firefly music server"
echo. > c:connected.sem
del c:notconnected.sem
goto end

:changetonotconnected
net stop "firefly music server"
echo. > c:notconnected.sem
del c:connected.sem
goto end

:end

daemon.bat


@echo off
goto start

:start
cls
call runcheck.bat
goto timeout

:timeout
if #%returnpath%# == #normal# set wait=10
if #%returnpath%# == #firstrun# set wait=0
goto loop

:loop
wait %wait%
goto start

download wait.exe

Regards,
William