Do `sudo` for each command here, perhaps like

```
sudo bash <<END_BASH
....
END_BASH
```

(not really tested)