File: transmogrify.sh

package info (click to toggle)
libreswan 4.14-1.1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 69,000 kB
  • sloc: ansic: 114,676; sh: 27,451; xml: 12,342; python: 10,400; makefile: 1,658; javascript: 1,358; perl: 584; sed: 534; yacc: 392; awk: 171
file content (38 lines) | stat: -rwxr-xr-x 863 bytes parent folder | download
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
#!/bin/sh

set -xe ; exec < /dev/null

GATEWAY=@@GATEWAY@@
POOLDIR=@@POOLDIR@@
SOURCEDIR=@@SOURCEDIR@@
TESTINGDIR=@@TESTINGDIR@@
PREFIX=@@PREFIX@@

echo GATEWAY=${GATEWAY}
echo POOLDIR=${POOLDIR}
echo SOURCEDIR=${SOURCEDIR}
echo TESTINGDIR=${TESTINGDIR}


# update /etc/fstab with current /source and /testing
mkdir -p /pool /source /testing
sed -e '/source/d' -e '/testing/d' /etc/fstab > /tmp/fstab
cat <<EOF | tee -a /tmp/fstab
${GATEWAY}:${SOURCEDIR}   /source         nfs     rw
${GATEWAY}:${TESTINGDIR}  /testing        nfs     rw
EOF
mv /tmp/fstab /etc/fstab

# change ROOT's shell to BASH
#
# Test scripts assume an SH like shell; but FreeBSD defaults to CSH.

chsh -s /usr/local/bin/bash root
cp -v /pool/${PREFIX}freebsd.bash_profile /root/.bash_profile

# suppress motd
touch /root/.hushlogin

cp -v /pool/${PREFIX}freebsd.rc.conf /etc/rc.conf

exit 0