Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > by-pkgid > ffa4f3ee607d635a956cb0ed31bf3de8 > files > 6

nspluginwrapper-1.4.4-0.1mdv2010.2.src.rpm

#!/bin/bash

if [ "$UID" != "0" ]; then
    echo "You need to be root"
    exit 1
fi

if [ "$1" == "--enable" ]; then
    if [ ! -f /etc/sysconfig/nspluginwrapper ]; then
        echo USE_NSPLUGINWRAPPER=yes > /etc/sysconfig/nspluginwrapper
    else
        if grep -q USE_NSPLUGINWRAPPER /etc/sysconfig/nspluginwrapper; then
            sed -i 's/USE_NSPLUGINWRAPPER=.*/USE_NSPLUGINWRAPPER=yes/' /etc/sysconfig/nspluginwrapper
        else
            echo USE_NSPLUGINWRAPPER=yes >> /etc/sysconfig/nspluginwrapper
        fi
    fi
    /var/lib/rpm/filetriggers/nspluginwrapper.script
elif [ "$1" == "--disable" ]; then
    if [ ! -f /etc/sysconfig/nspluginwrapper ]; then
        echo USE_NSPLUGINWRAPPER=no > /etc/sysconfig/nspluginwrapper
    else
        if grep -q USE_NSPLUGINWRAPPER /etc/sysconfig/nspluginwrapper; then
            sed -i 's/USE_NSPLUGINWRAPPER=.*/USE_NSPLUGINWRAPPER=no/' /etc/sysconfig/nspluginwrapper
        else
            echo USE_NSPLUGINWRAPPER=no >> /etc/sysconfig/nspluginwrapper
        fi
    fi
    nspluginwrapper -a -r
elif [ "$1" == "--update" ]; then
    nspluginwrapper -a -u
else
    echo "Sintax: $0 [--enable|--disable|--update]"
    exit 1
fi
exit $?