diff options
author | Leah Neukirchen <leah@vuxu.org> | 2022-01-07 01:02:22 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2022-01-07 01:02:22 +0100 |
commit | 07ba00058350948a8a5e89aa312c6f5b12098d93 (patch) | |
tree | d07d8185e2a026f588146cf17e26648fc486222e /contrib/rvnit/sv/08Smisc | |
parent | 5f76e13946b91213cae66d423a90a27eda24dc1a (diff) | |
download | rvnit-07ba00058350948a8a5e89aa312c6f5b12098d93.tar.gz rvnit-07ba00058350948a8a5e89aa312c6f5b12098d93.tar.xz rvnit-07ba00058350948a8a5e89aa312c6f5b12098d93.zip |
add contrib
Diffstat (limited to 'contrib/rvnit/sv/08Smisc')
-rwxr-xr-x | contrib/rvnit/sv/08Smisc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/contrib/rvnit/sv/08Smisc b/contrib/rvnit/sv/08Smisc new file mode 100755 index 0000000..ad11691 --- /dev/null +++ b/contrib/rvnit/sv/08Smisc @@ -0,0 +1,30 @@ +#!/bin/sh + +. /etc/rc.conf +. /etc/runit/functions + +# vim: set ts=4 sw=4 et: + +install -m0664 -o root -g utmp /dev/null /run/utmp +halt -B # for wtmp + +if [ -z "$VIRTUALIZATION" ]; then + msg "Initializing random seed..." + cp /var/lib/random-seed /dev/urandom >/dev/null 2>&1 || true +fi + +msg "Setting up loopback interface..." +ip link set up dev lo + +[ -r /etc/hostname ] && read -r HOSTNAME < /etc/hostname +if [ -n "$HOSTNAME" ]; then + msg "Setting up hostname to '${HOSTNAME}'..." + printf "%s" "$HOSTNAME" > /proc/sys/kernel/hostname +else + msg_warn "Didn't setup a hostname!" +fi + +if [ -n "$TIMEZONE" ]; then + msg "Setting up timezone to '${TIMEZONE}'..." + ln -sf "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime +fi |