From e717ae669a01639e631935ca31da967840adb5a9 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Mon, 7 Nov 2011 04:32:25 +0000 Subject: Prepare an example rc script that shows the new way of initialising a flavour --- examples/example/etc/rc.d/ezjail.flavour.example | 80 ++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100755 examples/example/etc/rc.d/ezjail.flavour.example diff --git a/examples/example/etc/rc.d/ezjail.flavour.example b/examples/example/etc/rc.d/ezjail.flavour.example new file mode 100755 index 0000000..4da6ffa --- /dev/null +++ b/examples/example/etc/rc.d/ezjail.flavour.example @@ -0,0 +1,80 @@ +#!/bin/sh +# +# BEFORE: DAEMON +# PROVIDE: ezjail.example.config +# +# ezjail flavour example + +# +case "$1" in + *start) + +# Remove traces of ourself +########################## + rm -f "/etc/rc.d/ezjail.flavour.example" + +# Run the main setup routines +############################# + flavour_setup() + + ;; + *) + ;; +esac + +flavour_setup() { + +# Groups +######### +# +# You will probably start with some groups your users should be in + +# pw groupadd -q -n coders # -g 1004 +# pw groupadd -q -n sales # -g 1005 + +# Users +######## +# +# You might want to add some users. The password is to be provided in the +# encrypted form as found in /etc/master.passwd. +# The example password here is "admin" +# Refer to crypt(3) and pw(8) for more information + +# echo -n '$1$p75bbfK.$Kz3dwkoVlgZrfLZdAXQt91' |\ +# pw useradd -n admin -u 1001 -s /bin/sh -m -d /home/admin -G wheel -c 'Admin User' -H 0 +# echo -n '$1$p75bbfK.$Kz3dwkoVlgZrfLZdAXQt91' |\ +# pw useradd -n saag -u 1002 -s /bin/sh -m -d /home/saag -G coders -c 'Mutton Saag' -H 0 +# echo -n '$1$p75bbfK.$Kz3dwkoVlgZrfLZdAXQt91' |\ +# pw useradd -n mac -u 1002 -s /bin/sh -m -d /home/mac -G sales -c 'Big Mac' -H 0 + +# Files +######## +# +# You can now give files to users just created + +# chown -R admin:coders /usr/local/cvsroot +# chown -R admin:sales /usr/local/nfs/sales + +# Packages +########### +# +# Install all packages previously put to /pkg +# Remove package files afterwards + +[ -d /pkg ] && PACKAGESITE=file:// pkg_add -r /pkg/* +rm -rf /pkg + +# Postinstall +############## +# +# Your own stuff here, for example set login shells that were only +# installed just before. + +# Please note, that for all network related stuff like ports, +# package remote fetching, etc. you need a sane /etc/resolv.conf + +# chpass -s /usr/local/bin/bash admin +# pkg_add -r pico +# cd /usr/ports/sysutils/screen && make install + +} -- cgit v1.2.3