вівторок, 14 червня 2016 р.

шифрування дисків по мережі

(із старих нотаток)

Azir: /sbin/checkflash

if [ ! -e /var/run/checkflash.pid ]; then
  /bin/date > /var/run/checkflash.pid
  /bin/mount -t cifs //comp/n /mnt/flash \
             -o ro,user=guest,password=""
  if [ -e /mnt/flash/.keyfile ]; then
    if [ -e /data/.no-crypt ]; then
      /sbin/cryptsetup -d /mnt/flash/.keyfile \
        luksOpen /dev/md2 dsk1
      /bin/mount /dev/mapper/dsk1 /data
      if[ -e /data/.LOCKfile ]; then
        /etc/init.d/nfs restart
      fi
    fi
  else
    if [ -e /data/.LOCKfile ]; then
      if [ -e /data/.VMS-IS-DOWN ]; then
        /bin/rm -f /data/.VMS-IS-DOWN && \
        /etc/init.d/nfs stop && \
        /bin/umount /data
      fi
    fi
  fi
  /bin/umount /mnt/flash
  /bin/rm -f /var/run/checkflash.pid
fi

APKTIKA: /sbin/checkflash

if [ ! -e /var/run/checkflash.pid ]; then
  /bin/date > /var/run/checkflash.pid
  /bin/mount -t cifs //comp/n /mnt/flash \
             -o ro,user=guest,password=""
  if [ -e /mnt/flash/.keyfile ]; then
    if [ -e /data/.no-mount ]; then
      /bin/mount AZIR:/data /data
      if [ ! -e /data/.LOCKfile ]; then
        /bin/umount /data
      else
        if [ ! -e /data/.VMS-IS-UP ]; then
          /usr/bin/vmware-cmd /data/ws2003/WS2003.vmx \
             -U root -P <password> start && \
          /bin/data > /data/.VMS-IS-IP
        fi
      fi
    fi
  else
    if [ -e /data/.VMS-IS-UP ]; then
      /etc/init.d/vmware stop && \
      /bin/date > /data/.VMS-IS-DOWN && \
      /bin/rm -f /data/.VMS-IS-UP
#    else
#      /bin/kill -9 \
#        `/bin/ps ax | /bin/grep vmware | \
#         /bin/grep -v grep | \
#         /bin/awk '{print $1}'`
#      /bin/date > /data/.VMS-IS-DOWN
    fi
  fi
  /bin/umount /mnt/flash
  /bin/rm -f /var/run/checkflash.pid
fi

Немає коментарів:

Дописати коментар