# Running script before applying an OTA update

**URL:** https://hub.mender.io/t/running-script-before-applying-an-ota-update/2299
**Category:** General Discussions
**Created:** [August 10, 2020, 9:08am UTC](https://hub.mender.io/t/running-script-before-applying-an-ota-update/2299 "2020-08-10T09:08:17Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![SamanRatna](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@SamanRatna](https://hub.mender.io/u/SamanRatna)
#### Post date: [August 10, 2020, 9:34am UTC](https://hub.mender.io/t/running-script-before-applying-an-ota-update/2299/3 "2020-08-10T09:34:21Z")

</div>

Actually, I want to apply a User Confirmation use case for my project. I tried the directory update as shown in [State scripting for Raspberry PI board running ubuntu 18.04](https://hub.mender.io/t/state-scripting-for-raspberry-pi-board-running-ubuntu-18-04/1203/3) and [How to create state scripts with Mender using Raspberry Pi](https://hub.mender.io/t/how-to-create-state-scripts-with-mender-using-raspberry-pi/1518). Deployment would be successful but, the script wouldn’t run.

Is there specific way or location to save the script ?  
The -s prefix wouldn’t run with directory-artifact-gen and I tried it by modifying the code from [https://github.com/mendersoftware/mender/blob/master/support/modules-artifact-gen/directory-artifact-gen](https://github.com/mendersoftware/mender/blob/master/support/modules-artifact-gen/directory-artifact-gen)

![image](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/1X/795e4b99f52dbe5763b5ea980602044624c2d6dc.png)

by adding -s ~/Downloads/ArtifactInstall\_Enter\_01\_User\_Confirmation-v2.py , but that didn’t work too.

---

_[View the full topic](https://hub.mender.io/t/running-script-before-applying-an-ota-update/2299)._
