summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-05-12 18:55:41 -0500
committerJohn Southworth <john.southworth@vyatta.com>2011-05-12 18:55:41 -0500
commit514125a2246ee477809a325a7661be08a15c8482 (patch)
tree304dace26fd27f14cc8f25347b2cab2cf95fdd8e /scripts
parent81731da16519e452ab2d4eb913ee01e5468a1905 (diff)
parent0a59c2f58a44f1caf4304429ace5d2d76d8867b8 (diff)
downloadvyatta-cfg-quagga-514125a2246ee477809a325a7661be08a15c8482.tar.gz
vyatta-cfg-quagga-514125a2246ee477809a325a7661be08a15c8482.zip
Merge branch 'napa' of git.vyatta.com:/git/vyatta-cfg-system into napa
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/init-floppy29
-rwxr-xr-xscripts/install/install-functions11
-rwxr-xr-xscripts/install/install-image-existing6
-rwxr-xr-xscripts/install/install-image-new6
-rwxr-xr-xscripts/rl-system.init9
5 files changed, 40 insertions, 21 deletions
diff --git a/scripts/init-floppy b/scripts/init-floppy
index 16e12915..9f5301d8 100755
--- a/scripts/init-floppy
+++ b/scripts/init-floppy
@@ -64,7 +64,7 @@ config_notice="\rSaving config... \c"
config__error="\rError: Couldn't save config in $fd/config/config.boot"
bind___notice="\rRedirecting config directory...\c"
bind____error="\rError: redirect to floppy"
-saved__notice="\rYour configuration was saved in: $fd/config/config.boot"
+saved__notice="\rYour configuration directory was saved to: $fd/config"
mkdir -p $fd
@@ -92,16 +92,31 @@ echo "$mount__notice"
/bin/mount /dev/fd0 $fd -t ext2 -o sync,noatime,noexec,nosuid,nodev &>/dev/null || \
failure "$mount___error"
-/bin/mkdir $fd/config
-/bin/chmod 777 $fd/config
-
-echo "$config_notice"
-${vyatta_sbindir}/vyatta-save-config.pl $fd/config/config.boot &>/dev/null || \
- failure "$config__error"
+#
+# Check to make sure we have enough space to copy the config dir
+#
+fd_space_avail=`df -k $fd | tail -1 | awk '{ print $4 }'`
+space_needed=`du -s ${vyatta_sysconfdir}/config | awk '{ print $1 }'`
+
+if [ $fd_space_avail -gt $space_needed ]; then
+ echo "$config_notice"
+ /bin/mkdir $fd/config
+ /usr/bin/find ${vyatta_sysconfdir}/config -maxdepth 1 -mindepth 1 \
+ -exec /bin/cp '-a' '{}' "$fd/config" ';'
+ /bin/chgrp -R vyattacfg $fd/config
+ /bin/chmod -R 775 $fd/config
+else
+ echo 'Not enough space to save current configuration directory'
+ failure "$config__error"
+fi
echo "$bind___notice"
/bin/mount -o bind $fd/config ${vyatta_sysconfdir}/config &>/dev/null || \
failure "$bind____error"
+# also, bind mount config directory to /config
+/bin/mkdir -p /config
+/bin/mount -o bind $fd/config /config &>/dev/null || \
+ failure "$bind____error"
echo "$saved__notice"
diff --git a/scripts/install/install-functions b/scripts/install/install-functions
index ffaea22d..5670f82a 100755
--- a/scripts/install/install-functions
+++ b/scripts/install/install-functions
@@ -96,9 +96,14 @@ get_response () {
local ldefault=$(tolower "$1")
local loptions=$(tolower "$2")
- # get the response from the user
- read myresponse
- myresponse=$(tolower "$myresponse")
+
+ if [ "$VYATTA_PROCESS_CLIENT" == "gui2_rest" ]; then
+ myresponse=$ldefault
+ else
+ # get the response from the user
+ read myresponse
+ myresponse=$(tolower "$myresponse")
+ fi
# Check to see if the user accepts the default
if [ -z "$myresponse" ]; then
diff --git a/scripts/install/install-image-existing b/scripts/install/install-image-existing
index 491f6499..13af9bf8 100755
--- a/scripts/install/install-image-existing
+++ b/scripts/install/install-image-existing
@@ -57,7 +57,11 @@ NEWVER=`dpkg -l --root=${CD_SQUASH_ROOT} | grep "^.. vyatta-version " | awk '{p
NEWNAME=$NEWVER
echo -n "What would you like to name this image? [$NEWNAME]: "
-read response
+if [ "$VYATTA_PROCESS_CLIENT" == "gui2_rest" ]; then
+ response=$NEWNAME
+else
+ read response
+fi
if [ -n "$response" ]; then
badchars=`echo $response | sed -e 's/[a-zA-Z0-9\.\_+-]//g'`
if [ -n "$badchars" ]; then
diff --git a/scripts/install/install-image-new b/scripts/install/install-image-new
index c669da8e..3097392a 100755
--- a/scripts/install/install-image-new
+++ b/scripts/install/install-image-new
@@ -31,7 +31,11 @@ if [ -z "$image_name" ]; then
fi
echo -n "What would you like to name this image? [$image_name]: "
-read response
+if [ "$VYATTA_PROCESS_CLIENT" == "gui2_rest" ]; then
+ response=$NEWNAME
+else
+ read response
+fi
if [ -n "$response" ]; then
badchars=`echo $response | sed -e 's/[a-zA-Z0-9\.\_+-]//g'`
if [ -n "$badchars" ]; then
diff --git a/scripts/rl-system.init b/scripts/rl-system.init
index 115bbc7d..d6f974f7 100755
--- a/scripts/rl-system.init
+++ b/scripts/rl-system.init
@@ -27,7 +27,6 @@ source /etc/default/vyatta
: ${vyatta_bindir:=${vyatta_prefix}/bin}
: ${vyatta_sbindir:=${vyatta_prefix}/sbin}
: ${vyatta_sysconfdir:=${vyatta_prefix}/etc}
-: ${hostname:=`hostname -s`}
[[ $PATH == *${vyatta_bindir}* ]] || PATH+=:${vyatta_bindir}
[[ $PATH == *${vyatta_sbindir}* ]] || PATH+=:${vyatta_sbindir}
@@ -40,14 +39,6 @@ export DEBIAN_FRONTEND=noninteractive
## BOOTFILE is provided by ofr.init
: ${BOOTFILE:=$prefix/etc/config/config.boot}
-if [ -z "$LOGFILE" ] ; then
- if touch /var/log/messages &> /dev/null ; then
- LOGFILE=/var/log/messages
- else
- LOGFILE=/dev/null
- fi
-fi
-
syslog ()
{
logger -p user.warning -t "$progname" "$*"