mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-19 14:56:46 +02:00
20 lines
363 B
Bash
20 lines
363 B
Bash
#!/sbin/openrc-run
|
|
|
|
# Copyright (c) Natanael Copa
|
|
# This code is licensed under BSD-2-Clause
|
|
|
|
description="Generate machine-id if needed"
|
|
|
|
depend() {
|
|
need root dev
|
|
}
|
|
|
|
start() {
|
|
if [ -s /etc/machine-id ] ; then
|
|
return 0
|
|
fi
|
|
ebegin "Generating machine-id"
|
|
dd if=/dev/urandom status=none bs=16 count=1 \
|
|
| md5sum | cut -d' ' -f1 > /etc/machine-id
|
|
eend $?
|
|
}
|