don't need semicolon
Use sed instead of perl
Exit if pushing fails; sleep a bit to avoid suspected race condition