Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > 9f4a785799562ccf60cf1fe14b281226 > files > 6

nspluginwrapper-1.4.4-1.mga1.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 $?