source: n4d/trunk/fuentes/debian/n4d.postinst @ 107

Last change on this file since 107 was 107, checked in by hectorgh, 4 years ago

wip

File size: 497 bytes
Line 
1#!/bin/sh
2
3set -e
4FILESECRET="/etc/n4d/key"
5CERTPATH="/etc/n4d/cert/"
6CERTNAME="n4d"
7case "$1" in
8   configure)
9        if [ ! -e "$FILESECRET" ]; then
10                cat /dev/urandom 2>/dev/null | tr -dc '0-9a-zA-Z' 2>/dev/null |{ head -c 50;echo ""; } > $FILESECRET
11        fi
12        chmod 400 $FILESECRET
13        chown root:root $FILESECRET
14       
15        /usr/share/n4d/certgen/n4d-certgen
16
17        systemctl enable n4d.service --now
18       
19   ;;
20
21   abort-upgrade|abort-remove|abort-deconfigure)
22   ;;
23
24   *)
25       exit 1
26   ;;
27esac
28
29#DEBHELPER#
30
31exit 0
32
Note: See TracBrowser for help on using the repository browser.