Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > a7eb709ebaab767476510ae8cb6c4991 > scriptlet

smolt-1.4-2mdv2010.0.noarch.rpm

PREIN

/bin/sh
/usr/share/rpm-helper/add-user smolt $1 smolt /usr/share/smolt /sbin/nologin

POSTIN

/bin/sh
if [ $1 = 1 ]
then
    cat /proc/sys/kernel/random/uuid > /etc/sysconfig/hw-uuid
    chmod 0644 /etc/sysconfig/hw-uuid
    chown root:root /etc/sysconfig/hw-uuid
    python > /etc/cron.d/smolt << 'EOF'

from string import Template
from random import randint

cron_file = Template('''# Runs the smolt checkin client
$minute $hour $day * * smolt [ -r /etc/sysconfig/smolt ]  && . /etc/sysconfig/smolt && [ $ENABLE_MONTHLY_UPDATE = 1 ] && /usr/bin/smoltSendProfile -a > /dev/null 2>&1
''')

def main():
    minute = randint(0,59)
    hour = randint(0, 24)
    day = randint(0, 28) #account for febu-hairy

    print cron_file.safe_substitute(minute=minute, day=day, hour=hour)

if __name__ == '__main__':
    main()
EOF
fi

POSTUN

/bin/sh
/usr/share/rpm-helper/del-user smolt $1 smolt 
/usr/share/rpm-helper/del-group smolt $1 smolt