Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release-src > by-pkgid > a484a855f266cae4e809c9e19f47ad93 > files > 11

nspluginwrapper-1.4.4-8.mga5.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 $?