include relevant portions of the upgradeGLASS1 script plus onLock: clause