And I apologize in advance for this shameless, disgusting bit of bash script.