changed references to scripts

This commit is contained in:
lars 2005-07-21 19:53:49 +00:00
parent 740085e271
commit b5bb85424e
13 changed files with 59 additions and 18 deletions

View file

@ -18,8 +18,11 @@ TEST_CASES_DIR=/usr/share/cryptobox/test-cases
SUMMARY_TEMPLATE_DIR=/usr/share/cryptobox/templates/test-summary SUMMARY_TEMPLATE_DIR=/usr/share/cryptobox/templates/test-summary
# some files # some files
CB_SCRIPT=/scripts/cryptobox.sh CB_SCRIPT=/usr/lib/cryptobox/cbox-manage.sh
VALIDATE_SCRIPT=/usr/lib/cryptobox/validate.sh VALIDATE_SCRIPT=/usr/lib/cryptobox/validate.sh
DEV_FEATURES_SCRIPT=/usr/lib/cryptobox/devel-features.sh
FIREWALL_SCRIPT=/usr/lib/cryptobox/firewall.sh
MAKE_CERT_SCRIPT=/usr/lib/cryptobox/make_stunnel_cert.sh
LOG_FILE=/var/log/cryptobox.log LOG_FILE=/var/log/cryptobox.log
DEVELOPMENT_MARKER=/DEVELOPMENT_CRYPTOBOX DEVELOPMENT_MARKER=/DEVELOPMENT_CRYPTOBOX
CERT_FILE=/mnt/cb-etc/stunnel.pem CERT_FILE=/mnt/cb-etc/stunnel.pem

View file

@ -2,15 +2,17 @@
set -eu set -eu
. /etc/cryptobox/cryptobox.conf
ACTION=help ACTION=help
[ $# -gt 0 ] && ACTION="$1" [ $# -gt 0 ] && ACTION="$1"
case "$ACTION" in case "$ACTION" in
start ) start )
/scripts/cryptobox.sh services-up $CB_SCRIPT services-up
;; ;;
stop ) stop )
/scripts/cryptobox.sh services-down $CB_SCRIPT services-down
;; ;;
restart ) restart )
$0 stop $0 stop

View file

@ -8,10 +8,10 @@
set -eu set -eu
MARKER=/DEVELOPMENT_CRYPTOBOX . /etc/cryptobox/cryptobox.conf
# return, if it does not exist # return, if it does not exist
[ ! -e "$MARKER" ] && exit 0 [ ! -e "$DEVELOPMENT_MARKER" ] && exit 0
echo echo
echo "#---------------------------------------------------------------#" echo "#---------------------------------------------------------------#"
@ -22,4 +22,4 @@ echo "| offers no security at all! |"
echo "#---------------------------------------------------------------#" echo "#---------------------------------------------------------------#"
echo echo
/scripts/devel-features.sh "$@" $DEV_FEATURES_SCRIPT "$@"

View file

@ -2,15 +2,17 @@
set -eu set -eu
. /etc/cryptobox/cryptobox.conf
ACTION=help ACTION=help
[ $# -gt 0 ] && ACTION="$1" [ $# -gt 0 ] && ACTION="$1"
case "$ACTION" in case "$ACTION" in
start ) start )
/scripts/cryptobox.sh config-up $CB_SCRIPT config-up
;; ;;
stop ) stop )
/scripts/cryptobox.sh config-down $CB_SCRIPT config-down
;; ;;
restart ) restart )
$0 stop $0 stop

View file

@ -2,15 +2,17 @@
set -eu set -eu
. /etc/cryptobox/cryptobox.conf
ACTION=help ACTION=help
[ $# -gt 0 ] && ACTION="$1" [ $# -gt 0 ] && ACTION="$1"
case "$ACTION" in case "$ACTION" in
start ) start )
/scripts/cryptobox.sh network-up $CB_SCRIPT network-up
;; ;;
stop ) stop )
/scripts/cryptobox.sh network-down $CB_SCRIPT network-down
;; ;;
restart ) restart )
$0 stop $0 stop

View file

@ -3,6 +3,10 @@
# this script does EVERYTHING # this script does EVERYTHING
# all other scripts are only frontends :) # all other scripts are only frontends :)
# #
# called by:
# - some rc-scripts
# - the web frontend cgi
#
set -eu set -eu
@ -10,7 +14,7 @@ set -eu
. /etc/cryptobox/cryptobox.conf . /etc/cryptobox/cryptobox.conf
## configuration ## configuration
MARKER="$CONFIG_DIR/cryptobox.marker" CONFIG_MARKER="$CONFIG_DIR/cryptobox.marker"
CERT_TEMP=/tmp/stunnel.pem CERT_TEMP=/tmp/stunnel.pem
##### #####
@ -86,7 +90,7 @@ function create_config()
# mount the config partition rw # mount the config partition rw
mount "$device" "$CONFIG_DIR" mount "$device" "$CONFIG_DIR"
# create a marker to recognize a cryptobox partition # create a marker to recognize a cryptobox partition
date -I >"$MARKER" date -I >"$CONFIG_MARKER"
## write (network) interfaces ## write (network) interfaces
cp -a "$CONFIG_DEFAULTS_DIR/." "$CONFIG_DIR" cp -a "$CONFIG_DEFAULTS_DIR/." "$CONFIG_DIR"
@ -147,7 +151,7 @@ function config_mount_test()
function is_config_mounted() function is_config_mounted()
{ {
mount | grep -q " ${CONFIG_DIR} " && [ -f "$MARKER" ] mount | grep -q " ${CONFIG_DIR} " && [ -f "$CONFIG_MARKER" ]
} }
@ -282,12 +286,12 @@ case "$ACTION" in
conf_ip=$(config_get_value "ip") conf_ip=$(config_get_value "ip")
ifconfig $NET_IFACE "$conf_ip" ifconfig $NET_IFACE "$conf_ip"
echo "Configured network interface for $NET_IFACE: $conf_ip" echo "Configured network interface for $NET_IFACE: $conf_ip"
/scripts/firewall.sh start $FIREWALL_SCRIPT start
# start stunnel # start stunnel
if [ -f "$CERT_FILE" ] if [ -f "$CERT_FILE" ]
then USE_CERT=$CERT_FILE then USE_CERT=$CERT_FILE
else USE_CERT=$CERT_TEMP else USE_CERT=$CERT_TEMP
/scripts/make_stunnel_cert.sh "$CERT_TEMP" >>"$LOG_FILE" 2>&1 $MAKE_CERT_SCRIPT "$CERT_TEMP" >>"$LOG_FILE" 2>&1
fi fi
stunnel -p "$USE_CERT" -r localhost:80 -d 443 \ stunnel -p "$USE_CERT" -r localhost:80 -d 443 \
|| echo "$USE_CERT not found - not starting stunnel" || echo "$USE_CERT not found - not starting stunnel"
@ -296,7 +300,7 @@ case "$ACTION" in
ping -b -c 1 $(ifconfig $NET_IFACE | grep Bcast | cut -d ":" -f 3 | cut -d " " -f 1) &>/dev/null ping -b -c 1 $(ifconfig $NET_IFACE | grep Bcast | cut -d ":" -f 3 | cut -d " " -f 1) &>/dev/null
;; ;;
network-down ) network-down )
/scripts/firewall.sh stop $FIREWALL_SCRIPT stop
killall stunnel killall stunnel
ifconfig $NET_IFACE down ifconfig $NET_IFACE down
;; ;;

View file

@ -15,6 +15,9 @@
# iptables -A INPUT -i eth0 -p udp --dport 138 -j ACCEPT # iptables -A INPUT -i eth0 -p udp --dport 138 -j ACCEPT
# iptables -A INPUT -i eth0 -p tcp --dport 139 -j ACCEPT # iptables -A INPUT -i eth0 -p tcp --dport 139 -j ACCEPT
# #
# called by:
# - TODO: this script is not in use, yet
#
set -eu set -eu

View file

@ -1,4 +1,12 @@
#!/bin/sh #!/bin/sh
#
# FOR DEVELOPMENT ONLY!
#
# this script is used to prepare a chroot session for testing
#
# called by:
# - cbox-build.sh
#
set -eu set -eu

View file

@ -1,6 +1,9 @@
#!/bin/sh #!/bin/sh
# #
# this script is only called during the making of the cryptobox cd # this script is part of the building process of the cryptobox
#
# called by:
# - cbox-build.sh after copying custom files and before creating the iso image
# #
set -eu set -eu

View file

@ -4,6 +4,9 @@
# #
# it should really NEVER be executed on a production system # it should really NEVER be executed on a production system
# #
# called by:
# - /etc/rc2.d/S99cb-devel-features.sh (only if $DEVELPMENT_MARKER exists)
#
set -eu set -eu

View file

@ -2,6 +2,9 @@
# #
# set up the firewall of the cryptobox # set up the firewall of the cryptobox
# #
# called by:
# - cbox-manage.sh during network-up
#
set -u set -u

View file

@ -4,6 +4,9 @@
# #
# parameter: "destination file" # parameter: "destination file"
# #
# called by:
# - cbox-manage.sh during network-up if no certificate was found on the config partition
#
set -eu set -eu

View file

@ -1,9 +1,14 @@
#!/bin/sh #!/bin/sh
# #
# do a validation # do a validation - ONLY FOR DEVELOPMENT!
#
# it will not work, if /var/www/report is read-only (as for a production cd)
# #
# use "--help" for a list of possible actions # use "--help" for a list of possible actions
# #
# called by:
# - /var/www/cgi-bin/validate.sh for conducting validation tests
#
set -eu set -eu