summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-11-24 11:50:33 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-11-24 11:50:33 -0800
commitd83fa3cc3ba4e4d3cf90a10f93772fae0cb00034 (patch)
tree0a0e572e481e687d49f834ae3133b6eebd4a83ea
parent85b1df2edc7c47fc6cac61f5f5cc0150d102bda9 (diff)
parentc12b9ae4ef02f54233e9d390d08591e761d84d04 (diff)
downloadvyatta-cfg-d83fa3cc3ba4e4d3cf90a10f93772fae0cb00034.tar.gz
vyatta-cfg-d83fa3cc3ba4e4d3cf90a10f93772fae0cb00034.zip
Merge branch 'mendocino' of vm:rel/vyatta-cfg into mendocino
-rw-r--r--.gitignore76
-rw-r--r--Makefile.am4
-rwxr-xr-xetc/bash_completion.d/vyatta-cfg (renamed from etc/bash_completion.d/20vyatta-cfg)0
-rw-r--r--src/net_set.c79
4 files changed, 39 insertions, 120 deletions
diff --git a/.gitignore b/.gitignore
index 44d745e..e6d1f62 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,42 +7,42 @@
*.deps
.dirstamp
libtool
-/aclocal.m4
-/autom4te.cache
-/config
-/config.log
-/config.guess
-/config.status
-/config.sub
-/configure
-/debian/files
-/debian/tmp
-/debian/vyatta-cfg
-/debian/vyatta-cfg.postinst
-/debian/vyatta-cfg.postrm
-/debian/libvyatta-cfg-dev
-/debian/libvyatta-cfg1
-/debian/*.log
-/debian/*.substvars
-/debian/*.debhelper
-/debian/stamp-*
-/INSTALL
-/Makefile.in
-/Makefile
-/src/my_commit
-/src/my_set
-/src/my_delete
-/src/check_tmpl
-/src/dump
-/src/exe_action
-/src/priority
-/src/net_set
-/src/cli_def.c
-/src/cli_parse.c
-/src/cli_parse.h
-/src/cli_val.c
-/src/cparse/cparse.cpp
-/src/cparse/cparse.h
-/src/cparse/cparse_lex.c
-/tools/rl_passwd
+aclocal.m4
+autom4te.cache
+config
+config.log
+config.guess
+config.status
+config.sub
+configure
+debian/files
+debian/tmp
+debian/vyatta-cfg
+debian/vyatta-cfg.postinst
+debian/vyatta-cfg.postrm
+debian/libvyatta-cfg-dev
+debian/libvyatta-cfg1
+debian/*.log
+debian/*.substvars
+debian/*.debhelper
+debian/stamp-*
+INSTALL
+Makefile.in
+Makefile
+src/my_commit
+src/my_set
+src/my_delete
+src/check_tmpl
+src/dump
+src/exe_action
+src/priority
+src/net_set
+src/cli_def.c
+src/cli_parse.c
+src/cli_parse.h
+src/cli_val.c
+src/cparse/cparse.cpp
+src/cparse/cparse.h
+src/cparse/cparse_lex.c
+tools/rl_passwd
diff --git a/Makefile.am b/Makefile.am
index 5d30019..17567f9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,7 +14,7 @@ AM_CXXFLAGS = -I src -Wall -Werror
AM_YFLAGS = -d --name-prefix=yy_`basename $* .y`_
AM_LFLAGS = --prefix=yy_`basename $* .l`_ -olex.yy.c
-completion_SCRIPTS = etc/bash_completion.d/20vyatta-cfg
+completion_DATA = etc/bash_completion.d/vyatta-cfg
initd_SCRIPTS = etc/init.d/vyatta-router
dhcphook_SCRIPTS = scripts/vyatta-dhclient-hook
@@ -71,7 +71,6 @@ sbin_PROGRAMS += src/my_commit
sbin_PROGRAMS += src/exe_action
sbin_PROGRAMS += src/dump
sbin_PROGRAMS += src/check_tmpl
-sbin_PROGRAMS += src/net_set
sbin_PROGRAMS += src/my_cli_bin
sbin_PROGRAMS += src/my_cli_shell_api
@@ -80,7 +79,6 @@ src_my_commit_SOURCES = src/commit2.c
src_exe_action_SOURCES = src/exe_action.c
src_dump_SOURCES = src/dump_session.c
src_check_tmpl_SOURCES = src/check_tmpl.c
-src_net_set_SOURCES = src/net_set.c
src_my_cli_bin_SOURCES = src/cli_bin.cpp
src_my_cli_shell_api_SOURCES = src/cli_shell_api.cpp
diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/vyatta-cfg
index 110b563..110b563 100755
--- a/etc/bash_completion.d/20vyatta-cfg
+++ b/etc/bash_completion.d/vyatta-cfg
diff --git a/src/net_set.c b/src/net_set.c
deleted file mode 100644
index a84cea4..0000000
--- a/src/net_set.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Program to set sysfs value - similar to sysctl commmand
- */
-
-#include <stdio.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-
-#define SYS "/sys"
-
-static void get(const char *name)
-{
- char path[PATH_MAX];
- char buf[BUFSIZ];
- FILE *f;
-
- snprintf(path, PATH_MAX, SYS "/%s", name);
- f = fopen(path, "r");
- if (f == NULL) {
- fprintf(stderr, "%s : %s\n", path, strerror(errno));
- exit(1);
- }
-
- while (fgets(buf, BUFSIZ, f) != NULL)
- fputs(buf, stdout);
-
- if (ferror(f)) {
- fprintf(stderr, "%s : read %s\n", path, strerror(errno));
- exit(1);
- }
- fclose(f);
-}
-
-static void set(const char *name, const char *val)
-{
- FILE *f;
- char path[PATH_MAX];
-
- snprintf(path, PATH_MAX, SYS "/%s", name);
- f = fopen(path, "w");
- if (f == NULL) {
- fprintf(stderr, "%s : %s\n", path, strerror(errno));
- exit(1);
- }
-
- fprintf(f, "%s\n", val);
- fflush(f);
-
- if (ferror(f)) {
- fprintf(stderr, "%s : read %s\n", path, strerror(errno));
- exit(1);
- }
- fclose(f);
-}
-
-int main(int argc, char **argv)
-{
- if (argc == 1) {
- fprintf(stderr, "Usage: %s variable\n", argv[0]);
- fprintf(stderr, " %s variable=value\n", argv[0]);
- return 1;
- }
-
- while (--argc) {
- char *ep, *arg = *++argv;
-
- ep = strchr(arg, '=');
- if (!ep)
- get(arg);
- else {
- *ep++ = '\0';
- set(arg, ep);
- }
- }
-
- return 0;
-}