Tessel.prototype.fixOldUpdateScripts = function() {
  return new Promise((resolve, reject) => {
      // Read the common.sh file that needs to be replaced into memory
      fs.readFile(path.join(__dirname, '../../resources/openwrt/common.sh'), (err, contents) => {
        if (err) {
          return reject(err);
        } else {
          // Open stdin to a new temporary file
          this.connection.exec(commands.openStdinToFile('/lib/upgrade/common_tmp.sh'), (err, remoteProcess) => {
            if (err) {
              return reject(err);
            } else {
              // When we finish writing the file, resolve
              remoteProcess.once('close', resolve);

              // Write the contents of the file to the process
              remoteProcess.stdin.end(contents);
            }
          });
        }
      });
    })
    // Rename the temporary file to the real file name before finishing
    .then(() => this.simpleExec(commands.moveFolder('/lib/upgrade/common_tmp.sh', '/lib/upgrade/common.sh')));
};