This repository has been archived by the owner on Feb 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
/
pfSense_sync_with_image.sh
executable file
·170 lines (154 loc) · 6.39 KB
/
pfSense_sync_with_image.sh
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#!/bin/sh
DESTDIRROOT=/home/sullrich/pfSense
# mini_httpd.c patch
# Download mini_httpd.c patch from m0n0wall site if doesnt exist.
if [ ! -e /usr/ports/www/mini_httpd/files/patch-mini_httpd.c ]; then
cd /usr/ports/www/mini_httpd/files && \
fetch http://m0n0.ch/wall/downloads/mini_httpd.c.patch
mv /usr/ports/www/mini_httpd/files/mini_httpd.c.patch \
/usr/ports/www/mini_httpd/files/patch-mini_httpd.c
fi
# atareinit
if [ ! -e $DESTDIRROOT/usr/local/sbin/atareinit ]; then
fetch http://m0n0.ch/wall/downloads/atareinit.c
gcc -o $DESTDIRROOT/usr/local/sbin/atareinit atareinit.c
rm atareinit.c
fi
# minicron
if [ ! -e $DESTDIRROOT/usr/local/minicron ]; then
fetch http://m0n0.ch/wall/downloads/minicron.c
gcc -o $DESTDIRROOT/usr/local/bin/minicron minicron.c
rm minicron.c
fi
# bpalogin
if [ ! -e $DESTDIRROOT/usr/local/sbin/bpalogin ]; then
fetch http://bpalogin.sourceforge.net/download/bpalogin-2.0.2.tar.gz
tar xzvpf bpalogin-2.0.2.tar.gz
cd bpalogin-2.0.2 && ./configure && make
cp bpalogin $DESTDIRROOT/usr/local/sbin/bpalogin
cd .. rm -rf bpa*
fi
cd /home/sullrich/pfSense/bin && \
for item in * ; do
cd /usr/src/bin/$item && make clean && make && make install
done
PACKAGES="/usr/ports/net/mpd \
/usr/ports/security/racoon \
/usr/ports/net/wol \
/usr/ports/dns/ez-ipupdate \
/usr/ports/net/msntp \
/usr/ports/net/isc-dhcp3-server \
/usr/ports/www/mini_httpd \
/usr/ports/net-mgmt/choparp \
/usr/ports/dns/dnsmasq \
/usr/ports/security/openvpn \
/usr/ports/net-mgmt/net-snmp4 \
/usr/ports/www/links"
# Uncomment this to automatically install packages.
for package in $PACKAGES; do
cd $package && make clean install WITHOUT_X11=yes BATCH=yes
done
rm -rf /var/db/pkg/*
# copy files from host to pfSense skeleton image.
mkdir -p $DESTDIRROOT/usr/local/bin/
install -s /usr/local/bin/ez-ipupdate $DESTDIRROOT/usr/local/bin/
install -s /usr/local/bin/msntp $DESTDIRROOT/usr/local/bin/
install -s /usr/local/bin/wol $DESTDIRROOT/usr/local/bin/
install -s /usr/local/bin/minicron $DESTDIRROOT/usr/local/bin/
#cp /usr/local/bin/php $DESTDIRROOT/usr/local/bin/
install -s /usr/local/bin/links $DESTDIRROOT/usr/local/bin/
chmod a+x $DESTDIRROOT/usr/local/bin/*
mkdir -p $DESTDIRROOT/usr/local/sbin/
install -s /usr/local/sbin/atareinit $DESTDIRROOT/usr/local/sbin/
install -s /usr/local/sbin/dhcpd $DESTDIRROOT/usr/local/sbin/
install -s /usr/local/sbin/mini_httpd $DESTDIRROOT/usr/local/sbin/
install -s /usr/local/sbin/bpalogin $DESTDIRROOT/usr/local/sbin/
install -s /usr/local/sbin/mpd $DESTDIRROOT/usr/local/sbin/
install -s /usr/local/sbin/racoon $DESTDIRROOT/usr/local/sbin/
install -s /usr/local/sbin/choparp $DESTDIRROOT/usr/local/sbin/
install -s /usr/local/sbin/dnsmasq $DESTDIRROOT/usr/local/sbin/
install -s /usr/local/sbin/openvpn $DESTDIRROOT/usr/local/sbin/
install -s /usr/local/sbin/snmpd $DESTDIRROOT/usr/local/sbin/
chmod a+x $DESTDIRROOT/usr/local/sbin/*
mkdir -p $DESTDIRROOT/sbin/
install -s /sbin/adjkerntz $DESTDIRROOT/sbin/
install -s /sbin/init $DESTDIRROOT/sbin/
install -s /sbin/kldunload $DESTDIRROOT/sbin/
install -s /sbin/route $DESTDIRROOT/sbin/
install -s /sbin/dhclient $DESTDIRROOT/sbin/
install -s /sbin/ipf $DESTDIRROOT/sbin/
install -s /sbin/ldconfig $DESTDIRROOT/sbin/
install -s /sbin/mount_procfs $DESTDIRROOT/sbin/
install -s /sbin/shutdown $DESTDIRROOT/sbin/
install -s /sbin/dhclient-script $DESTDIRROOT/sbin/
install -s /sbin/ipfs $DESTDIRROOT/sbin/
install -s /sbin/mount $DESTDIRROOT/sbin/
install -s /sbin/mount_std $DESTDIRROOT/sbin/
install -s /sbin/sysctl $DESTDIRROOT/sbin/
install -s /sbin/dmesg $DESTDIRROOT/sbin/
install -s /sbin/ipfstat $DESTDIRROOT/sbin/
install -s /sbin/umount $DESTDIRROOT/sbin/
install -s /sbin/fastboot $DESTDIRROOT/sbin/
install -s /sbin/ipfw $DESTDIRROOT/sbin/
install -s /sbin/fasthalt $DESTDIRROOT/sbin/
install -s /sbin/ipmon $DESTDIRROOT/sbin/
install -s /sbin/mount_linprocfs $DESTDIRROOT/sbin/
install -s /sbin/nologin $DESTDIRROOT/sbin/
install -s /sbin/halt $DESTDIRROOT/sbin/
install -s /sbin/ipnat $DESTDIRROOT/sbin/
install -s /sbin/mount_mfs $DESTDIRROOT/sbin/
install -s /sbin/ping $DESTDIRROOT/sbin/
install -s /sbin/ifconfig $DESTDIRROOT/sbin/
install -s /sbin/kldload $DESTDIRROOT/sbin/
install -s /sbin/reboot $DESTDIRROOT/sbin/
chmod a+x $DESTDIRROOT/sbin/*
mkdir -p $DESTDIRROOT/bin
install -s /bin/[ $DESTDIRROOT/bin/
install -s /bin/date $DESTDIRROOT/bin/
install -s /bin/expr $DESTDIRROOT/bin/
install -s /bin/mkdir $DESTDIRROOT/bin/
install -s /bin/sleep $DESTDIRROOT/bin/
install -s /bin/cat $DESTDIRROOT/bin/
install -s /bin/dd $DESTDIRROOT/bin/
install -s /bin/hostname $DESTDIRROOT/bin/
install -s /bin/ps $DESTDIRROOT/bin/
install -s /bin/stty $DESTDIRROOT/bin/
install -s /bin/chmod $DESTDIRROOT/bin/
install -s /bin/df $DESTDIRROOT/bin/
install -s /bin/kill $DESTDIRROOT/bin/
install -s /bin/rm $DESTDIRROOT/bin/
install -s /bin/sync $DESTDIRROOT/bin/
install -s /bin/cp $DESTDIRROOT/bin/
install -s /bin/echo $DESTDIRROOT/bin/
install -s /bin/ls $DESTDIRROOT/bin/
install -s /bin/sh $DESTDIRROOT/bin/
install -s /bin/test $DESTDIRROOT/bin/
chmod a+x $DESTDIRROOT/$DESTDIRROOT/bin/*
mkdir -p $DESTDIRROOT/usr/sbin
install -s /usr/sbin/ancontrol $DESTDIRROOT/usr/sbin/
install -s /usr/sbin/chroot $DESTDIRROOT/usr/sbin/
install -s /usr/sbin/pccardd $DESTDIRROOT/usr/sbin/
#cp /usr/sbin/syslogd $DESTDIRROOT/usr/sbin/
install -s /usr/sbin/arp $DESTDIRROOT/usr/sbin/
install -s /usr/sbin/clog $DESTDIRROOT/usr/sbin/
install -s /usr/sbin/pwd_mkdb $DESTDIRROOT/usr/sbin/
install -s /usr/sbin/wicontrol $DESTDIRROOT/usr/sbin/
install -s /usr/sbin/chown $DESTDIRROOT/usr/sbin/
install -s /usr/sbin/dev_mkdb $DESTDIRROOT/usr/sbin/
install -s /usr/sbin/setkey $DESTDIRROOT/usr/sbin/
chmod a+x $DESTDIRROOT/ $DESTDIRROOT/usr/sbin/*
mkdir -p $DESTDIRROOT/usr/bin/
install -s /usr/bin/gunzip $DESTDIRROOT/usr/bin/
install -s /usr/bin/killall $DESTDIRROOT/usr/bin/
install -s /usr/bin/netstat $DESTDIRROOT/usr/bin/
install -s /usr/bin/su $DESTDIRROOT/usr/bin/
install -s /usr/bin/tar $DESTDIRROOT/usr/bin/
install -s /usr/bin/touch $DESTDIRROOT/usr/bin/
install -s /usr/bin/w $DESTDIRROOT/usr/bin/
install -s /usr/bin/gzip $DESTDIRROOT/usr/bin/
install -s /usr/bin/logger $DESTDIRROOT/usr/bin/
install -s /usr/bin/nohup $DESTDIRROOT/usr/bin/
install -s /usr/bin/tail $DESTDIRROOT/usr/bin/
install -s /usr/bin/top $DESTDIRROOT/usr/bin/
install -s /usr/bin/uptime $DESTDIRROOT/usr/bin/
chmod a+x $DESTDIRROOT/ $DESTDIRROOT/usr/bin/*