Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > 9aebabd882027bd36a4129e4b5ef25f7 > scriptlet

csync2-1.34-5.fc14.i686.rpm

PREUN

/bin/sh
# Cleanup all databases upon last removal
if [ $1 -eq 0 ]; then
  /bin/rm -f /var/lib/csync2/*
fi

POSTIN

/bin/sh
umask 077
if [ ! -f /etc/csync2/csync2_ssl_key.pem ]; then
/usr/bin/openssl genrsa -rand /proc/apm:/proc/cpuinfo:/proc/dma:/proc/filesystems:/proc/interrupts:/proc/ioports:/proc/pci:/proc/rtc:/proc/uptime 1024 > /etc/csync2/csync2_ssl_key.pem 2>/dev/null
fi

FQDN=`hostname`
if [ "x${FQDN}" = "x" ]; then
   FQDN=localhost.localdomain
fi

if [ ! -f /etc/csync2/csync2_ssl_cert.pem ]; then
cat << EOF | /usr/bin/openssl req -new -key /etc/csync2/csync2_ssl_key.pem -x509 -days 3000 -out /etc/csync2/csync2_ssl_cert.pem 2>/dev/null
--
SomeState
SomeCity
SomeOrganization



EOF
fi