With you shaking the bike and then it starting ok I wonder if there is crap in the tank that is settling round the outlet for the petrol tap under the tank. When the bike is stood the crap sinks to the lowest point and restricts the fuel flow.
Or possibly I am talking crap, it has been known
Could be crap, but the way the engine starts then stops dead i have a gut feeling i've picked up water from somewhere.
The bike was in the garage overnight, so not wet at all and the temperature is mild so i can't blame weather conditions this time.
The difference today though was i started the bike in the garage, whereas i would normally wheel it out then put it back on the sidestand.
This movement may be more than enough to slosh the fuel about making it start easier in the mornings, but at work i start it where it's parked.
All still guesswork obviously but i think i'm on the right track.
Once i'd shaken the bike and got it started, i switched off and it was starting no problem at all afterwards.
I can't see why shaking the bike would fix an electrical fault.