2 * ----------------------------------------------------------------------------
3 * "THE BEER-WARE LICENSE" (Revision 42):
4 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you
5 * can do whatever you want with this stuff. If we meet some day, and you think
6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7 * ----------------------------------------------------------------------------
13 #include <sys/types.h>
16 #include <netinet/in.h>
17 #include <arpa/inet.h>
26 main(int argc, char **argv)
33 errx(1, "usage: %s path hostname ip-number command ...\n",
37 err(1, "chdir %s", argv[1]);
38 memset(&j, 0, sizeof(j));
42 i = inet_aton(argv[3], &in);
44 errx(1, "Couldn't make sense of ip-number\n");
45 j.ip_number = ntohl(in.s_addr);
48 err(1, "Imprisonment failed");
49 i = execv(argv[4], argv + 4);
51 err(1, "execv(%s)", argv[4]);