First check in after re-naming snap to sl. This involved a lot of variable renaming and there are likely a number of other little hacks and tweaks.
This commit is contained in:
45
ROOT/etc/sl.d/templates/server/postinst
Normal file
45
ROOT/etc/sl.d/templates/server/postinst
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user