| 1 | #!/sbin/openrc-run |
| 2 | |
| 3 | description="Postfix SRS Daemon" |
| 4 | pidfile="/run/postsrsd.pid" |
| 5 | command="/usr/sbin/postsrsd" |
| 6 | command_args="-D -C /etc/postsrsd/postsrsd.conf" |
| 7 | |
| 8 | stopsig="SIGTERM" |
| 9 | |
| 10 | start_pre() { |
| 11 | if [ ! -s /etc/postsrsd/postsrsd.secret ] |
| 12 | then |
| 13 | ebegin "Generating secret" |
| 14 | checkpath -Fm 0600 -o postsrsd /etc/postsrsd/postsrsd.secret |
| 15 | dd if=/dev/urandom bs=18 count=1 status=none \ |
| 16 | | base64 >/etc/postsrsd/postsrsd.secret |
| 17 | |
| 18 | eend $? |
| 19 | fi |
| 20 | } |