Skip to content

Instantly share code, notes, and snippets.

@amercier
Last active July 21, 2025 10:23
Show Gist options
  • Select an option

  • Save amercier/e64ee30eb3f96fcc42e3 to your computer and use it in GitHub Desktop.

Select an option

Save amercier/e64ee30eb3f96fcc42e3 to your computer and use it in GitHub Desktop.

Revisions

  1. amercier renamed this gist Dec 12, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. amercier revised this gist Dec 12, 2015. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -11,4 +11,6 @@ Go to *Control Panel* / *Task Scheduler* and add the content of these scripts as
    Codes have been taken from [this article](https://smallhacks.wordpress.com/2012/04/17/working-with-synology-hardware-devsynobios-and-devttys1/).

    - `turn-leds-off.sh`: turns leds off
    - `turn-leds-on.sh`: turn leds back on
    - `turn-leds-on.sh`: turn leds back on

    Ex (this is how I use it): turn leds daily at 10PM, turn them back on at 6AM.
  3. amercier revised this gist Dec 12, 2015. 2 changed files with 4 additions and 5 deletions.
    5 changes: 2 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,5 @@
    # Synology scheduled tasks
    # ========================

    Synology scheduled tasks
    ========================

    Usage
    -----
    4 changes: 2 additions & 2 deletions turn-leds-on.sh
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,6 @@

    printf \\x34 > /dev/ttyS1 # UART2_CMD_LED_POWER_ON
    printf \\x38 > /dev/ttyS1 # UART2_CMD_LED_HD_GS
    printf \\x42 > /dev/ttyS1 # UART2_CMD_LED_USB_ON
    printf \\x40 > /dev/ttyS1 # UART2_CMD_LED_USB_ON
    printf \\x4A > /dev/ttyS1 # UART2_CMD_LED_10G_LAN_ON
    printf \\x50 > /dev/ttyS1 # UART2_CMD_LED_MIRROR_GS
    printf \\x51 > /dev/ttyS1 # UART2_CMD_LED_MIRROR_GS
  4. amercier revised this gist Dec 12, 2015. 3 changed files with 27 additions and 5 deletions.
    15 changes: 15 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    # Synology scheduled tasks
    # ========================


    Usage
    -----

    Go to *Control Panel* / *Task Scheduler* and add the content of these scripts as `root` scripts.

    ### Leds

    Codes have been taken from [this article](https://smallhacks.wordpress.com/2012/04/17/working-with-synology-hardware-devsynobios-and-devttys1/).

    - `turn-leds-off.sh`: turns leds off
    - `turn-leds-on.sh`: turn leds back on
    10 changes: 5 additions & 5 deletions turn-leds-off.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/bin/sh

    printf \\x36 > /dev/ttyS1
    printf \\x37 > /dev/ttyS1
    printf \\x42 > /dev/ttyS1
    printf \\x4B > /dev/ttyS1
    printf \\x50 > /dev/ttyS1
    printf \\x36 > /dev/ttyS1 # UART2_CMD_LED_POWER_OFF
    printf \\x37 > /dev/ttyS1 # UART2_CMD_LED_HD_OFF
    printf \\x42 > /dev/ttyS1 # UART2_CMD_LED_USB_OFF
    printf \\x4B > /dev/ttyS1 # UART2_CMD_LED_10G_LAN_OFF
    printf \\x50 > /dev/ttyS1 # UART2_CMD_LED_MIRROR_OFF
    7 changes: 7 additions & 0 deletions turn-leds-on.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    #!/bin/sh

    printf \\x34 > /dev/ttyS1 # UART2_CMD_LED_POWER_ON
    printf \\x38 > /dev/ttyS1 # UART2_CMD_LED_HD_GS
    printf \\x42 > /dev/ttyS1 # UART2_CMD_LED_USB_ON
    printf \\x4A > /dev/ttyS1 # UART2_CMD_LED_10G_LAN_ON
    printf \\x50 > /dev/ttyS1 # UART2_CMD_LED_MIRROR_GS
  5. amercier renamed this gist Dec 12, 2015. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion leds-off.sh → turn-leds-off.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    #!/bin/sh
    # /usr/local/etc/rc.d/leds-off.sh

    printf \\x36 > /dev/ttyS1
    printf \\x37 > /dev/ttyS1
  6. amercier revised this gist Jul 9, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion leds-off.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #!/bin/sh
    #/usr/local/etc/rc.d/leds-off.sh
    # /usr/local/etc/rc.d/leds-off.sh

    printf \\x36 > /dev/ttyS1
    printf \\x37 > /dev/ttyS1
  7. amercier created this gist Jul 9, 2015.
    8 changes: 8 additions & 0 deletions leds-off.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    #!/bin/sh
    #/usr/local/etc/rc.d/leds-off.sh

    printf \\x36 > /dev/ttyS1
    printf \\x37 > /dev/ttyS1
    printf \\x42 > /dev/ttyS1
    printf \\x4B > /dev/ttyS1
    printf \\x50 > /dev/ttyS1