From ec7d1db2a8c9d8b1bdfec66acd88856bf62e52de Mon Sep 17 00:00:00 2001 From: MegaXLR Date: Wed, 4 Oct 2017 11:40:53 +0200 Subject: [PATCH] Add makefile. run make; sudo make install Signed-off-by: MegaXLR --- .gitignore | 3 +++ makefile | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 .gitignore create mode 100644 makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..11e83b4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +hosts +hostfile +.temp \ No newline at end of file diff --git a/makefile b/makefile new file mode 100644 index 0000000..05b17ed --- /dev/null +++ b/makefile @@ -0,0 +1,24 @@ +default: clean + echo "##COINHIVE DOMAINS">>hostfile; + sed 's/^/127\.0\.0\.1 /' domains >> hostfile + echo "##END COINHIVE">>hostfile; +install: + cp /etc/hosts hosts; + -rm .temp + sed '/##COINHIVE DOMAINS/,/##END COINHIVE/d' hosts >> .temp + cat hostfile >> .temp + mv .temp hosts + cp hosts /etc/hosts +clean: + if test -s "hostfile" ; \ + then \ + rm hostfile ;\ + fi + if test -s "hosts" ; \ + then \ + rm hosts ;\ + fi + if test -s ".temp" ; \ + then \ + rm .temp ;\ + fi \ No newline at end of file