mv2100 Skripte für LEDs etc

In Computer und Netzwerk HP Media Vault mv2100-Serie | Erstellt: 12.09.2010, 20:14 | Editiert: 25.10.2018, 16:51 | 6.792 mal angesehen | Seite drucken

Zurück zu "HP Media Vault MV2100-Serie"

Skripte

Die LED für "Health" und die beiden SATA-LEDs können via sysfs über Dateien in /sys/class/leds gesteuert werden.

Eine udev-Regel, um den Power-Button als Device /dev/input/powerbutton ansprechen zu können:

/etc/udev/rules.d/z50-mv2100-powerbutton.rules:

KERNEL=="event*", ENV{ID_PATH}=="platform-gpio-keys", SYMLINK+="input/powerbutton"

Skript led_health.sh, für die "Health"-LED (aus, rot, blau, blinkend):

#!/bin/bash

# Paths in sysfs
led_blue_base="/sys/class/leds/mv2120:blue:health/"
led_red_base="/sys/class/leds/mv2120:red:health/"

# Timer
t_on=500
t_off=1000

# Check for directories
if [ -d "$led_blue_base" ] && [ -d "$led_red_base" ]; then
   # There's LED-support
   case "$1" in
      red)
         echo none   > $led_blue_base/trigger
         echo none   > $led_red_base/trigger
         echo 0      > $led_blue_base/brightness
         echo 1      > $led_red_base/brightness
         ;;
      red-blink)
         echo 0      > $led_red_base/brightness
         echo 0      > $led_blue_base/brightness
         echo none   > $led_blue_base/trigger
         echo timer  > $led_red_base/trigger
         echo $t_off > $led_red_base/delay_off
         echo $t_on  > $led_red_base/delay_on
         ;;
      blue)
         echo none   > $led_blue_base/trigger
         echo none   > $led_red_base/trigger
         echo 0      > $led_red_base/brightness
         echo 1      > $led_blue_base/brightness
         ;;
      blue-blink)
         echo 0      > $led_red_base/brightness
         echo 0      > $led_blue_base/brightness
         echo none   > $led_red_base/trigger
         echo timer  > $led_blue_base/trigger
         echo $t_off > $led_blue_base/delay_off
         echo $t_on  > $led_blue_base/delay_on
         ;;
      off)
         echo none   > $led_blue_base/trigger
         echo none   > $led_red_base/trigger
         echo 0      > $led_red_base/brightness
         echo 0      > $led_blue_base/brightness
         ;;
      *)
         echo "$0 (red|red-blink|blue|blue-blink|off)"
         ;;
   esac
else
   echo "No LED support in kernel or module(s) / LED class not loaded."
   exit 1;
fi

exit 0

Skript cron_pull.sh zum Sichern des /data-Verzeichnisses des Data Vault X312 via rsync:

#!/bin/bash
#
# Pull von monster.local.lan
#

# PID von rsync
rsync_pid=`pidof rsync`

if ! [ -z "$rsync_pid" ]; then
   echo
   echo "*** Rsync laeuft bereits. ***"
   echo
   exit 1;
fi

# Quelle
source="rsync://monster:/data"

# Ziel
target="/data/monster"

# Optionen
rsoptions_base=" -arv --stats "
rsoptions_exclude=" --exclude='/videorecorder' "
#rsoptions_delete=" --delete "

# LED blue blink
echo "Setting Health-LED to blinking blue"
/data/scripts/led_health.sh blue-blink

# Rsync
rsync $rsoptions_base $rsoptions_exclude $rsoptions_delete $source $target

# LED blue
echo "Setting Health-LED tos static blue"
/data/scripts/led_health.sh blue

Weitere Seiten in 'HP Media Vault mv2100-Serie'

Schreibe einen Kommentar

Captcha * Time limit is exhausted. Please reload CAPTCHA.