1#!/bin/sh 2# 3# BEFORE: DAEMON 4# PROVIDE: ezjail.example.config 5# 6# ezjail flavour example 7 8. /etc/rc.subr 9 10name=ezjail.flavour.example 11start_cmd=flavour_setup 12 13flavour_setup() { 14 15# Remove traces of ourself 16# N.B.: Do NOT rm $0, it points to /etc/rc 17########################## 18 rm -f "/etc/rc.d/ezjail.flavour.example" 19 20# Groups 21######### 22# 23# You will probably start with some groups your users should be in 24 25# pw groupadd -q -n coders # -g 1004 26# pw groupadd -q -n sales # -g 1005 27 28# Users 29######## 30# 31# You might want to add some users. The password is to be provided in the 32# encrypted form as found in /etc/master.passwd. 33# The example password here is "admin" 34# Refer to crypt(3) and pw(8) for more information 35 36# echo -n '$1$p75bbfK.$Kz3dwkoVlgZrfLZdAXQt91' |\ 37# pw useradd -n admin -u 1001 -s /bin/sh -m -d /home/admin -G wheel -c 'Admin User' -H 0 38# echo -n '$1$p75bbfK.$Kz3dwkoVlgZrfLZdAXQt91' |\ 39# pw useradd -n saag -u 1002 -s /bin/sh -m -d /home/saag -G coders -c 'Mutton Saag' -H 0 40# echo -n '$1$p75bbfK.$Kz3dwkoVlgZrfLZdAXQt91' |\ 41# pw useradd -n mac -u 1002 -s /bin/sh -m -d /home/mac -G sales -c 'Big Mac' -H 0 42 43# Files 44######## 45# 46# You can now give files to users just created 47 48# chown -R admin:coders /usr/local/cvsroot 49# chown -R admin:sales /usr/local/nfs/sales 50 51# Packages 52########### 53# 54# Install all packages previously put to /pkg 55# Remove package files afterwards 56 57[ -d /pkg ] && cd /pkg && pkg_add /pkg/* 58rm -rf /pkg 59 60# Postinstall 61############## 62# 63# Your own stuff here, for example set login shells that were only 64# installed just before. 65 66# Please note, that for all network related stuff like ports, 67# package remote fetching, etc. you need a sane /etc/resolv.conf 68 69# chpass -s /usr/local/bin/bash admin 70# pkg_add -r pico 71# cd /usr/ports/sysutils/screen && make install 72 73} 74 75run_rc_command "$1" 76