-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomize
executable file
·56 lines (42 loc) · 1.73 KB
/
customize
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/bash
PATH=/opt/local/gnu/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin
# Exit if any commands fail
set -o errexit
# Configuring image specific packages
echo "* Configuring image specific packages.";
/usr/sbin/useradd -g other -m -s /usr/bin/bash znc
if ! projects -l znc >/dev/null 2>&1; then
LANG=C projadd -U znc -G other \
-K "process.max-file-descriptor=(basic,16384,deny)" \
-c "ZNC IRC bouncer" znc
fi
svccfg import /root/znc.xml
# Clean up
echo "* Cleaning up."
pkgin clean
rm -rf /root/*
/usr/bin/rm -rf /opt/local
/usr/bin/curl -k http://pkgsrc.joyent.com/packages/SmartOS/bootstrap/bootstrap-2014Q2-i386.tar.gz | /usr/bin/gzcat | /usr/bin/tar -xf - -C /
pkg_add http://pkgsrc.joyent.com/packages/SmartOS/2014Q2/i386/All/smtools-20140905.tgz
pkg_add http://pkgsrc.joyent.com/packages/SmartOS/2014Q2/i386/All/zoneinit-1.6.8.tgz
pkg_add http://pkgsrc.joyent.com/packages/SmartOS/2014Q2/i386/All/rsyslog-8.2.2nb4.tgz
pkg_add http://pkgsrc.joyent.com/packages/SmartOS/2014Q2/i386/All/sudo-1.7.10p8.tgz
cat > /opt/local/etc/rsyslog.conf << EOF
#
# Sample rsyslog configuration file
#
$ModLoad immark
$ModLoad imsolaris
# $ModLoad imtcp
# $ModLoad imudp
*.err;kern.notice;auth.notice /dev/sysmsg
*.err;kern.debug;daemon.notice;mail.crit /var/adm/messages
*.alert;kern.err;daemon.err :omusrmsg:operator
*.alert :omusrmsg:root
*.emerg :omusrmsg:*
mail.debug /var/log/syslog
mail.info /var/log/maillog
auth.info /var/log/authlog
EOF
# Prepare image for provisioning
sm-prepare-image -y