Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
remove no use code and crate
Browse files Browse the repository at this point in the history
  • Loading branch information
guni1192 committed Feb 4, 2019
1 parent cad04db commit f458737
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 272 deletions.
207 changes: 0 additions & 207 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,4 @@ edition = "2018"

[dependencies]
nix = "0.11.0"
getopts = "0.2"
dirs = "1.0"
clap = "2.32.0"
libc = "*"
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ mod commands;
mod container;
mod mounts;
mod network;
mod options;
mod runner;

fn main() {
Expand Down
15 changes: 0 additions & 15 deletions src/options.rs

This file was deleted.

47 changes: 1 addition & 46 deletions src/runner.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
use std::env;
use std::process;
use std::process::exit;

// use nix::sched::{unshare, CloneFlags};
use nix::unistd::getuid;

use clap::ArgMatches;
use nix::unistd::getuid;

// use super::bootstrap::pacstrap;
use super::container;
// use super::mounts;
use super::network::{Bridge, Network};
use super::options;

// TODO: deamonize option
pub fn run(sub_m: &ArgMatches) {
Expand Down Expand Up @@ -55,42 +49,3 @@ pub fn run(sub_m: &ArgMatches) {

container.run();
}

#[allow(dead_code)]
pub fn network(args: &[String]) {
let args = args.to_vec();
let matches = options::get_network_options(args).expect("Invalid arguments");

let container_name = matches
.opt_str("name")
.expect("invalied arguments about container name");

let network = Network::new(
format!("{}-ns", &container_name),
Bridge::new(),
format!("{}_host", &container_name),
format!("{}_guest", &container_name),
"172.0.0.2".parse().unwrap(),
);

if matches.opt_present("create-bridge") {
network
.bridge
.add_bridge_ace0()
.expect("Could not create bridge");
exit(0);
}

if matches.opt_present("delete-bridge") {
network
.bridge
.del_bridge_ace0()
.expect("Could not delete bridge");
exit(0);
}

if matches.opt_present("clean") {
network.clean().expect("Failed clean up network");
exit(0);
}
}

0 comments on commit f458737

Please sign in to comment.