Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > media > main > by-pkgid > bb23757c2103e08e206a6d1231227700 > files > 14

suspend-scripts-1.4-1mdk.noarch.rpm

#!/bin/bash
# -*- Mode: shell-script -*-
# Copyright (C) 2003 by MandrakeSoft, Chmouel Boudjnah <chmouel@mandrakesoft.com>
# Redistribution of this file is permitted under the terms of the GNU 
# Public License (GPL)
#
# resume: 15
# suspend: 70
#

. /etc/sysconfig/suspend

ARG=$1

if [[ $USB_RESTART != "yes" ]];then
    exit;
fi

function suspend {
    modules=`egrep -s "^(probeall|alias)( |\t)+usb-interface( |\t)+" /etc/modules.conf | sed "s/^.*usb-interface//"`
    umount /proc/bus/usb >/dev/null 2>&1
    for module in $modules; do
	modprobe -r $module >/dev/null 2>&1
    done
}

function resume {
    service usb start
}

case $ARG in
    suspend)
	suspend
	;;
    resume)
	resume
	;;
esac