summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-11-07 17:35:53 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-11-07 17:35:53 -0800
commitf4fcf512b96f7a14666d2254a0ab1890512a548e (patch)
tree1b289f64990aed877672fbda2672d026abb74f42
parent239545a6e81884091610c59e548448a15cadafbf (diff)
parenta96c79e41c61d25822fb16e7dfba28182a5fd2e9 (diff)
downloadvyatta-cfg-system-f4fcf512b96f7a14666d2254a0ab1890512a548e.tar.gz
vyatta-cfg-system-f4fcf512b96f7a14666d2254a0ab1890512a548e.zip
Merge branch 'islavista' of suva.vyatta.com:/git/vyatta-cfg-system into islavista
-rw-r--r--debian/vyatta-cfg-system.postinst.in4
-rw-r--r--scripts/dns-forwarding/vyatta-dns-forwarding.pl18
-rwxr-xr-xscripts/install-system4
-rw-r--r--scripts/snmp/vyatta-snmp.pl2
-rwxr-xr-xscripts/system/vyatta_update_login.pl2
-rw-r--r--templates/system/ip/disable-forwarding/node.def3
-rw-r--r--templates/system/ip/node.def1
-rw-r--r--templates/system/ipv6/disable-forwarding/node.def3
-rw-r--r--templates/system/ipv6/node.def1
-rw-r--r--templates/system/time-zone/node.def79
10 files changed, 76 insertions, 41 deletions
diff --git a/debian/vyatta-cfg-system.postinst.in b/debian/vyatta-cfg-system.postinst.in
index a814df9c..c4f43586 100644
--- a/debian/vyatta-cfg-system.postinst.in
+++ b/debian/vyatta-cfg-system.postinst.in
@@ -131,6 +131,10 @@ fi
cp -p /etc/syslog.conf /etc/syslog.conf.bak
cp -f /opt/vyatta/etc/syslog.conf /etc/syslog.conf
+# remove unnecessary ddclient script in /etc/ppp/ip-up.d/
+# this logs unnecessary messages trying to start ddclient
+rm -f /etc/ppp/ip-up.d/ddclient
+
# Local Variables:
# mode: shell-script
# sh-indentation: 4
diff --git a/scripts/dns-forwarding/vyatta-dns-forwarding.pl b/scripts/dns-forwarding/vyatta-dns-forwarding.pl
index 6cdcfaa0..d0d7e36c 100644
--- a/scripts/dns-forwarding/vyatta-dns-forwarding.pl
+++ b/scripts/dns-forwarding/vyatta-dns-forwarding.pl
@@ -57,7 +57,7 @@ sub dnsforwarding_get_constants {
sub dnsforwarding_get_values {
- my $dhclient_script = shift;
+ my $outside_cli = shift;
my $output = '';
my $config = new VyattaConfig;
@@ -66,7 +66,7 @@ sub dnsforwarding_get_values {
$config->setLevel("service dns forwarding");
- if ($dhclient_script == 1){
+ if ($outside_cli == 1){
$config->{_active_dir_base} = "/opt/vyatta/config/active/";
@listen_interfaces = $config->returnOrigValues("listen-on");
$cache_size = $config->returnOrigValue("cache-size");
@@ -104,7 +104,7 @@ sub dnsforwarding_get_values {
my $sys_config = new VyattaConfig;
$sys_config->setLevel("system");
my @system_nameservers;
- if ($dhclient_script == 1){
+ if ($outside_cli == 1){
$sys_config->{_active_dir_base} = "/opt/vyatta/config/active/";
@system_nameservers = $sys_config->returnOrigValues("name-server");
} else {
@@ -255,12 +255,12 @@ sub check_dhcp_interface {
# main
#
-my ($update_dnsforwarding, $stop_dnsforwarding, $system_nameserver, $dhcp_interface, $dhclient_script);
+my ($update_dnsforwarding, $stop_dnsforwarding, $system_nameserver, $dhcp_interface, $outside_cli);
GetOptions("update-dnsforwarding!" => \$update_dnsforwarding,
"stop-dnsforwarding!" => \$stop_dnsforwarding,
"system-nameserver!" => \$system_nameserver,
- "dhclient-script!" => \$dhclient_script,
+ "outside-cli!" => \$outside_cli,
"dhcp-interface=s" => \$dhcp_interface);
if (defined $system_nameserver) {
@@ -293,12 +293,12 @@ if (defined $update_dnsforwarding) {
}
}
- my $called_from_dhclient_script = 0;
- if (defined $dhclient_script){
- $called_from_dhclient_script = 1;
+ my $called_from_outside_cli = 0;
+ if (defined $outside_cli){
+ $called_from_outside_cli = 1;
}
$config = dnsforwarding_get_constants();
- $config .= dnsforwarding_get_values($called_from_dhclient_script);
+ $config .= dnsforwarding_get_values($called_from_outside_cli);
dnsforwarding_write_file($config);
dnsforwarding_restart();
}
diff --git a/scripts/install-system b/scripts/install-system
index ee0ebb5f..8993ab10 100755
--- a/scripts/install-system
+++ b/scripts/install-system
@@ -735,7 +735,9 @@ install_root_filesystem () {
output=$(mount /live/image/boot/$version/$version.squashfs /mnt/squashfs -t squashfs -o loop)
status=$?
else
- echo -e "Error: Unable to find a squash image. \nExiting..."
+ echo -e "Error: Unable to find a squash image. To install natively\nthe install media must be a livecd or a union install.\nExiting...\n\n"
+ echo -e "Error: Unable to find a squash image. To install natively\nthe install media must be a livecd or a union install.\nExiting...\n\n" >> $INSTALL_LOG
+ exit 1
fi
if [ "$status" != 0 ]; then
diff --git a/scripts/snmp/vyatta-snmp.pl b/scripts/snmp/vyatta-snmp.pl
index 58dc374f..65247788 100644
--- a/scripts/snmp/vyatta-snmp.pl
+++ b/scripts/snmp/vyatta-snmp.pl
@@ -62,6 +62,8 @@ sub snmp_get_constants {
my $date = `date`;
chomp $date;
$output = "#\n# autogenerated by vyatta-snmp.pl on $date\n#\n";
+ $output .= "sysDescr Vyatta\n";
+ $output .= "sysObjectID 1.3.6.1.4.1.30803\n";
$output .= "sysServices 14\n";
$output .= "smuxpeer .1.3.6.1.4.1.3317.1.2.2\n"; # ospfd
$output .= "smuxpeer .1.3.6.1.4.1.3317.1.2.5\n"; # bgpd
diff --git a/scripts/system/vyatta_update_login.pl b/scripts/system/vyatta_update_login.pl
index dbe4e338..1f71434b 100755
--- a/scripts/system/vyatta_update_login.pl
+++ b/scripts/system/vyatta_update_login.pl
@@ -53,7 +53,7 @@ my %reasons = (
# Map of level to additional groups
my %level_map = (
- 'admin' => [ 'quaggavty', 'vyattacfg', 'sudo', 'adm', 'dip', ],
+ 'admin' => [ 'quaggavty', 'vyattacfg', 'sudo', 'adm', 'dip', 'disk'],
'operator' => [ 'quaggavty', 'operator', 'adm', 'dip', ],
);
diff --git a/templates/system/ip/disable-forwarding/node.def b/templates/system/ip/disable-forwarding/node.def
new file mode 100644
index 00000000..3bac48b3
--- /dev/null
+++ b/templates/system/ip/disable-forwarding/node.def
@@ -0,0 +1,3 @@
+help: Disable IPv4 forwarding
+create: sudo sh -c "echo 0 > /proc/sys/net/ipv4/conf/all/forwarding"
+delete: sudo sh -c "echo 1 > /proc/sys/net/ipv4/conf/all/forwarding"
diff --git a/templates/system/ip/node.def b/templates/system/ip/node.def
new file mode 100644
index 00000000..c354d882
--- /dev/null
+++ b/templates/system/ip/node.def
@@ -0,0 +1 @@
+help: Set IPv4 settings
diff --git a/templates/system/ipv6/disable-forwarding/node.def b/templates/system/ipv6/disable-forwarding/node.def
new file mode 100644
index 00000000..5a7576c3
--- /dev/null
+++ b/templates/system/ipv6/disable-forwarding/node.def
@@ -0,0 +1,3 @@
+help: Disable IPv6 forwarding
+create: sudo sh -c "echo 0 > /proc/sys/net/ipv6/conf/all/forwarding"
+delete: sudo sh -c "echo 1 > /proc/sys/net/ipv6/conf/all/forwarding"
diff --git a/templates/system/ipv6/node.def b/templates/system/ipv6/node.def
new file mode 100644
index 00000000..7a7c2715
--- /dev/null
+++ b/templates/system/ipv6/node.def
@@ -0,0 +1 @@
+help: Set IPv6 settings
diff --git a/templates/system/time-zone/node.def b/templates/system/time-zone/node.def
index e271e3e6..00179850 100644
--- a/templates/system/time-zone/node.def
+++ b/templates/system/time-zone/node.def
@@ -1,35 +1,54 @@
type: txt
help: Set local timezone
default: "GMT"
-update:expression: "LTF=\"/usr/share/zoneinfo\" && \
-case \"$VAR(@)\" in \
- [Ll][Oo][Ss]*) LTF=\"$LTF/US/Pacific\" ;; \
- [Dd][Ee][Nn]*) LTF=\"$LTF/US/Mountain\" ;; \
- [Hh][Oo][Nn]*) LTF=\"$LTF/US/Hawaii\" ;; \
- [Nn][Ee][Ww]*) LTF=\"$LTF/US/Eastern\" ;; \
- [Cc][Hh][Ii]*) LTF=\"$LTF/US/Central\" ;; \
- [Aa][Nn][Cc]*) LTF=\"$LTF/US/Alaska\" ;; \
- [Pp][Hh][Oo]*) LTF=\"$LTF/US/Arizona\" ;; \
- *) LTF=\"$LTF/Etc/$VAR(@)\" ;; \
-esac && \
-if [ -e \"$LTF\" ]; then \
- sudo ln -fs $LTF /etc/localtime; \
-else \
- echo \"Invalid timezone\"; \
- exit 1; \
-fi"
+update: LTF="/usr/share/zoneinfo"
+ case "$VAR(@)" in
+ [Ll][Oo][Ss]*) LTF="$LTF/US/Pacific" ;;
+ [Dd][Ee][Nn]*) LTF="$LTF/US/Mountain" ;;
+ [Hh][Oo][Nn][Oo]*) LTF="$LTF/US/Hawaii" ;;
+ [Nn][Ee][Ww]*) LTF="$LTF/US/Eastern" ;;
+ [Cc][Hh][Ii][Cc]*) LTF="$LTF/US/Central" ;;
+ [Aa][Nn][Cc]*) LTF="$LTF/US/Alaska" ;;
+ [Pp][Hh][Oo]*) LTF="$LTF/US/Arizona" ;;
+ GMT*) LTF="$LTF/Etc/$VAR(@)" ;;
+ *) LTF="$LTF/$VAR(@)" ;;
+ esac
+ if [ -f "$LTF" ]; then
+ sudo ln -fs $LTF /etc/localtime
+ else
+ echo "Invalid timezone"
+ exit 1
+ fi
delete:expression: "sudo ln -fs /usr/share/zoneinfo/GMT /etc/localtime"
-allowed: local -a list=( "Los Angeles" "New York" "Denver" "Chicago" \
- "Anchorage" "Honolulu" "Phoenix" "GMT" )
- for (( i = -1; i > -13; i-- )); do
- list[${#list[@]}]="GMT$i";
+allowed: word=${COMP_WORDS[$COMP_CWORD]}
+ if [[ $word == */* ]]; then
+ marr=($(ls -d /usr/share/zoneinfo/$word*))
+ else
+ marr=($(find /usr/share/zoneinfo/ -maxdepth 1 -type d \
+ -name "$word*"))
+ fi
+ if (( ${#marr[@]} == 1 )); then
+ word=${marr[0]#/usr/share/zoneinfo/}
+ fi
+ if [ -n "$word" ] && [[ $word != */ ]]; then
+ marr=($(ls -d /usr/share/zoneinfo/$word*))
+ if (( ${#marr[@]} == 1 )) \
+ && [ -d "/usr/share/zoneinfo/$word" ]; then
+ word=$word/
+ elif [[ $word == */* ]]; then
+ word=${word%/*}/
+ fi
+ fi
+ for z in $(ls -d /usr/share/zoneinfo/$word* \
+ 2>/dev/null | egrep '^/usr/share/zoneinfo/[A-Z]'); do
+ zz=${z#/usr/share/zoneinfo/}
+ if [ -d $z ] || [[ $zz == */* ]]; then
+ echo \"$zz\"
+ fi
done
- for (( i = 1; i < 13; i++ )); do
- list[${#list[@]}]="GMT+$i";
- done
- for zone in "${list[@]}"; do
- echo \"$zone\"
- done
-comp_help:Enter one of the following time zones:
- Honolulu Anchorage Los Angeles Phoenix Denver Chicago New York
- GMT GMT-1 ... GMT-12 GMT+1 ... GMT+12
+comp_help:Enter the local timezone by specifying "Region/City"
+ Use auto-completion to see available regions and cities.
+ Start with one of these regions:
+ Africa America Antarctica Arctic Asia Atlantic
+ Australia Brazil Canada Chile Europe Indian
+ Mexico Mideast Pacific US