#! /bin/sh ### BEGIN INIT INFO # Provides: llxcfg-ocfs2-umount-net # Required-Start: $local_fs $remote_fs $network # Required-Stop: $local_fs $remote_fs # Default-Start: S # Default-Stop: 0 1 6 # Short-Description: fix export/net # Description: fix export/net ### END INIT INFO PATH=/bin:/usr/bin:/sbin:/usr/sbin NAME=llxcfg-ocfs2-umount-net SCRIPTNAME=/etc/init.d/$NAME VAR_LIST="OCFS2_NET_EXPORT_DIRS OCFS2_DISK OCFS2_MOUNT_FSTAB LLIUREX_PXE_FLAVOURS" LLX_GETVAR="/usr/sbin/llxcfg-showvars" ZNB_HOME="/net/zero-net-boot/tftp/modelo-" PXE_HOME="/var/lib/tcos/tftp/edit-" eval `${LLX_GETVAR} ${VAR_LIST}` mount_test(){ if mount |grep -q "^${1}[[:blank:]]\+on[[:blank:]]\+${2}\b" ; then return 0 fi return 1 } do_stop() { if [ -x "/sbin/mount.ocfs2" ] && [ $OCFS2_DISK ]; then [ -e /etc/ocfs2/umount.ocfs2 ] && . /etc/ocfs2/umount.ocfs2 for flavour in $LLIUREX_PXE_FLAVOURS;do case $flavour in biblio|server) flavour2="$flavour/casper/server.nfsroot" ;; client) flavour2="$flavour/casper/client.nfsroot" ;; desktop|infantil|lite|music|pime) flavour2="$flavour/casper/filesystem.nfsroot" ;; esac if [ -d "${PXE_HOME}${flavour}" ] && [ -d "${ZNB_HOME}${flavour2}" ]; then if mount_test "${ZNB_HOME}${flavour2}" "${PXE_HOME}${flavour}" ; then umount -l ${PXE_HOME}${flavour} 2>/dev/null || true fi fi done for ocfs_dir in $OCFS2_NET_EXPORT_DIRS; do umount -l /export/net/$ocfs_dir 2>/dev/null || true umount -l /net/$ocfs_dir 2>/dev/null || true done umount $OCFS2_DISK 2>/dev/null || true fi } case "$1" in start) exit 0 ;; restart|force-reload) exit 0 ;; stop) do_stop ;; *) echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2 exit 3 ;; esac exit 0