authentic2.postinst: creating file if NOT exist
This commit is contained in:
parent
b8eff0331c
commit
d639ef7e68
|
@ -28,10 +28,12 @@ case "$1" in
|
|||
$AUTHENTIC_USER
|
||||
echo "..done" >&2
|
||||
fi
|
||||
if [ -f "/etc/$NAME/secret" ]; then
|
||||
if [ ! -f "/etc/$NAME/secret" ]; then
|
||||
echo -n "Generating Django secret.." >&2
|
||||
echo "export SECRET_KEY='`</dev/urandom tr -dc [:alnum:]-_\!\%\^:\; | head -c70`'" > /etc/$NAME/secret
|
||||
chmod 0600 /etc/$NAME/secret
|
||||
chown $AUTHENTIC_USER:$AUTHENTIC_GROUP /etc/$NAME/secret
|
||||
echo "..done" >&2
|
||||
fi
|
||||
|
||||
chown $AUTHENTIC_USER:$AUTHENTIC_GROUP /var/lib/authentic2 \
|
||||
|
|
Loading…
Reference in New Issue