added rc-once script to initialize uuid on first start

This commit is contained in:
Thorsten Liepert 2017-08-04 13:23:18 +02:00 committed by Thomas Bernard
parent 74c6ab5a46
commit f7ec37d92f
1 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# generate a UUID on first system start
#
UUID=`uuidgen`
CONFFILE=/etc/miniupnpd/miniupnpd.conf
mv "${CONFFILE}" "${CONFFILE}.before"
sed -e "s/^uuid=[-0-9a-fA-F]*/uuid=$UUID/" "${CONFFILE}.before" > "${CONFFILE}"
rm "${CONFFILE}.before"