# How to specify custom script when event (none/falling/rising/change) happens
Note: The event is only available in input direction.

1. Create the script with the format: <name>.script
   e.g. DI1.script

2. Change the target event by (Can only set one event at a time)
  - Method 1. Modify in /etc/moxa/MoxaComputerInterfaceManager/peripheral-settings.conf ([DIO/DIx])

    - Event=0: none (default)
    - Event=1: falling edge
    - Event=2: rising edge
    - Event=3: change

  - Method 2. Use `mx-inteface-mgmt dio <name> set_event <event>` 

3. Remember to make script executable (e.g. chmod +x DI1.script)

4. Any modification will be triggered after restarting the service or use
  `mx-interface-mgmt dio <name> reload` to reload the configuration.
