Files
sl/ROOT/etc/sl.d/templates/server/postinst

46 lines
797 B
Bash

#!/bin/sh
### PLACEHOLDER ###
# This script needs to provide things like network setup perhaps
# This code should help with setting up the network interfaces
#
#my $dir = '/sys/class/net';
#my $devs = {};
#
#opendir( my $dh, $dir ) || die( $! );
#
#while ( readdir( $dh ) ) {
# my $link = readlink( "$dir/$_" ) || next;
#
# if ( $link =~ /virtual/ ) {
# next;
# }
#
# open( my $fh, "$dir/$_/address" ) || die( $! );
# $devs->{$_}{'mac'} = <$fh>;
# close( $fh );
#
# chomp( $devs->{$_}{'mac'} );
# }
#
#foreach my $dev ( sort( keys( %$devs ) ) ) {
# print "$dev - $devs->{$dev}{'mac'}\n";
# }
if [ -n "$HOSTNAME" ]; then
cat > /etc/hostname <<EOF
$HOSTNAME
EOF
fi
if [ -n "$ROOTPW" ]; then
chpasswd <<EOF
root:$ROOTPW
EOF
fi
if [ -n "$TZFILE" ]; then
ln -s "$TZFILE" /etc/localtime
fi