Skip to content

Commit ca8dad3

Browse files
authored
Merge pull request #8 from cedwards/master
0.3.20181114 fix all the things
2 parents 2533f44 + 8b7fb79 commit ca8dad3

File tree

12 files changed

+36
-25
lines changed

12 files changed

+36
-25
lines changed

usr/local/bin/bastille

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ SAVED_TERM=$TERM
3434
. /usr/local/etc/bastille/bastille.conf
3535

3636
## version
37-
BASTILLE_VERSION="0.3.20181112"
37+
BASTILLE_VERSION="0.3.20181114"
3838

3939

4040
usage() {
@@ -93,20 +93,10 @@ case "${CMD}" in
9393
cmd|cp|create|destroy|list|pkg|restart|start|stop|sysrc|template|verify)
9494
;;
9595
update|upgrade)
96-
CMD_ENV="${CMD_ENV} PAGER=cat"
9796
;;
9897
console|bootstrap|htop|top)
9998
;;
10099
bootstrap|update|upgrade)
101-
while read envvar envvalue; do
102-
case "${envvar}" in
103-
FETCH_BIND_ADDRESS|FTP_*|ftp_*|HTTP_*|http_*|SSL_|NO_PROXY|no_proxy|MAKEOBJDIRPREFIX)
104-
CMD_ENV="${CMD_ENV} ${envvar}=${envvalue}"
105-
;;
106-
esac
107-
done <<-EOF
108-
$(env | sed -Ee 's,^([^=]*)=(.*),\1 \2,')
109-
EOF
110100
;;
111101
*)
112102
usage
@@ -121,4 +111,4 @@ umask ${UMASK}
121111

122112
: ${SH:=sh}
123113

124-
exec env -i ${CMD_ENV} ${SH} "${SCRIPTPATH}" "$@"
114+
exec ${SH} "${SCRIPTPATH}" "$@"

usr/local/share/bastille/bootstrap.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,22 +110,22 @@ case "${RELEASE}" in
110110
;;
111111
12.0-BETA1)
112112
bootstrap
113-
echo -e "${COLOR_RED}BETA releases are complete untested.${COLOR_RESET}"
113+
echo -e "${COLOR_RED}BETA releases are completely untested.${COLOR_RESET}"
114114
;;
115115
12.0-BETA2)
116116
bootstrap
117-
echo -e "${COLOR_RED}BETA releases are complete untested.${COLOR_RESET}"
117+
echo -e "${COLOR_RED}BETA releases are completely untested.${COLOR_RESET}"
118118
;;
119119
12.0-BETA3)
120120
bootstrap
121-
echo -e "${COLOR_RED}BETA releases are complete untested.${COLOR_RESET}"
121+
echo -e "${COLOR_RED}BETA releases are completely untested.${COLOR_RESET}"
122122
;;
123123
12.0-BETA4)
124124
bootstrap
125-
echo -e "${COLOR_RED}BETA releases are complete untested.${COLOR_RESET}"
125+
echo -e "${COLOR_RED}BETA releases are completely untested.${COLOR_RESET}"
126126
;;
127127
*)
128-
echo -e "${COLOR_RED}BETA releases are complete untested.${COLOR_RESET}"
128+
echo -e "${COLOR_RED}BETA releases are completely untested.${COLOR_RESET}"
129129
usage
130130
;;
131131
esac

usr/local/share/bastille/cmd.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,5 @@ fi
5656
for _jail in ${JAILS}; do
5757
echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}"
5858
jexec -l ${_jail} $2
59+
echo
5960
done

usr/local/share/bastille/console.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,6 @@ fi
5555

5656
for _jail in ${JAILS}; do
5757
echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}"
58-
jexec -l ${_jail} /usr/bin/login -fp root
58+
jexec -l ${_jail} /usr/bin/login -f root
59+
echo
5960
done

usr/local/share/bastille/cp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ for _jail in ${JAILS}; do
5858
bastille_jail_path="${bastille_jailsdir}/${_jail}/root"
5959
echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}"
6060
cp -a "$2" "${bastille_jail_path}/$3"
61-
echo -e "${COLOR_RESET}"
61+
echo
6262
done

usr/local/share/bastille/freebsd_dist_fetch.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/bin/sh
2+
# https://pastebin.com/T6eThbKu
23

34
DEVICE_SELF_SCAN_ALL=NO
5+
DIALOG_BACKTITLE="BastilleBSD"
6+
DIALOG_TITLE="bootstrap"
47
[ "$_SCRIPT_SUBR" ] || . /usr/share/bsdconfig/script.subr
58
usage(){ echo "Usage: ${0##*/} [-r releaseName] [dists ...]" >&2; exit 1; }
69
while getopts hr: flag; do
@@ -21,13 +24,13 @@ REL_DIST=/usr/local/bastille/cache/$releaseName
2124
download() # $src to $dest
2225
{
2326
size=$( f_device_get device_media "$1" $PROBE_SIZE )
24-
f_device_get device_media "$1" | dpv -kb "BastilleBSD" \
25-
-t "bootstrap" -p "Downloading $releaseName" \
27+
f_device_get device_media "$1" | dpv -kb "$DIALOG_BACKTITLE" \
28+
-t "$DIALOG_TITLE" -p "Downloading $releaseName" \
2629
-o "$3" "$size:$1"
2730
}
2831
sign() # $file
2932
{
30-
dpv -kb "BastilleBSD" -t "bootstrap" \
33+
dpv -kb "$DIALOG_BACKTITLE" -t "$DIALOG_TITLE" \
3134
-p "Signing $releaseName" -mx "sha256 >&2" \
3235
"$size:${1##*/}" "$1" 2>&1 >&$TERMINAL_STDOUT_PASSTHRU
3336
}

usr/local/share/bastille/list.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@
2929
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030

3131
. /usr/local/share/bastille/colors.pre.sh
32+
. /usr/local/etc/bastille/bastille.conf
3233

3334
usage() {
34-
echo -e "${COLOR_RED}Usage: bastille list.${COLOR_RESET}"
35+
echo -e "${COLOR_RED}Usage: bastille list [release|template|jail|log].${COLOR_RESET}"
3536
exit 1
3637
}
3738

@@ -45,6 +46,18 @@ if [ $# -gt 0 ]; then
4546
help|-h|--help)
4647
usage
4748
;;
49+
release|releases)
50+
ls "${bastille_releasesdir}"
51+
;;
52+
template|templates)
53+
ls "${bastille_templatesdir}"
54+
;;
55+
jail|jails)
56+
ls "${bastille_jailsdir}"
57+
;;
58+
log|logs)
59+
ls "${bastille_logsdir}"
60+
;;
4861
*)
4962
usage
5063
;;

usr/local/share/bastille/pkg.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,5 @@ fi
5656
for _jail in ${JAILS}; do
5757
echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}"
5858
jexec -l ${_jail} /usr/sbin/pkg $2
59+
echo
5960
done

usr/local/share/bastille/service.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ fi
5757
for _jail in ${JAILS}; do
5858
echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}"
5959
jexec -l ${_jail} /usr/sbin/service $2
60-
echo -e "${COLOR_RESET}"
60+
echo
6161
done

usr/local/share/bastille/start.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ fi
6262
for _jail in ${JAILS}; do
6363
echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}"
6464
jail -f "${bastille_jailsdir}/${_jail}/jail.conf" -c ${_jail}
65+
echo
6566
done
6667

6768
## HUP the firewall

usr/local/share/bastille/stop.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ fi
5757
for _jail in ${JAILS}; do
5858
echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}"
5959
jail -f "${bastille_jailsdir}/${_jail}/jail.conf" -r ${_jail}
60+
echo
6061
done
6162

6263
## HUP the firewall

usr/local/share/bastille/template.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ for _jail in ${JAILS}; do
6464
if [ -s "${bastille_template}/PRE" ]; then
6565
echo -e "${COLOR_GREEN}Executing PRE-command(s).${COLOR_RESET}"
6666
bastille_templatepre=$(cat "${bastille_template}/PRE")
67-
jexec -l "${_jail}" "${bastille_templatepre}"
67+
jexec -l "${_jail}" /bin/sh "${bastille_templatepre}"
6868
fi
6969

7070
## config

0 commit comments

Comments
 (0)