#! /bin/bash mydisks() { find $* -type l -printf "%f %l\n" | egrep -v '^md|-part|wwn-' | egrep ^ata | sed -e 's#.*/##g'| tr '\n' ' ' } # This is really important, because we use shell globbing for creating the list of disks cd /dev/disk/by-id || echo Cannot get disk information case $HOSTNAME in # kueppers) newlist=$(mydisks *WD3000FYYZ* *0F400HGN* ) ;; bierkranz) newlist=$(mydisks *WDC_WD320* *ST31000* *SAMSUNG_HD502* ) ;; backup) newlist=$(mydisks *INTEL_SSDSC2CW240A3* *WDC_WD* ) ;; esac if [ -n "$newlist" ]; then echo New disklist: $newlist echo disklist=\"$newlist\" >> $LOGDIR/additional.var fi