-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (33 loc) · 1.32 KB
/
Makefile
File metadata and controls
38 lines (33 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Inspired by https://github.com/dylanaraps/neofetch
INSTALL_DIR = /usr/local/bin
SHELL = /usr/bin/env sh
all:
@echo Run \'make install\' to install shellsec.
@echo Run \'make uninstall\' to uninstall shellsec.
@echo Run \'make complete\' to add bash auto completion to your .bashrc.
@echo For custom installation directory, use \'make INSTALL_DIR=...\'.
@echo Current installation directory is \'$(INSTALL_DIR)\'.
install:
@echo Making directory $(INSTALL_DIR)...
@mkdir -p $(INSTALL_DIR)
@echo Copying files to it...
@cp shellsec $(INSTALL_DIR)/
@cp shellsec-setkey $(INSTALL_DIR)/
@cp shellsec-complete $(INSTALL_DIR)/
@echo Making scripts executable...
@chmod 755 $(INSTALL_DIR)/shellsec
@chmod 755 $(INSTALL_DIR)/shellsec-setkey
@chmod 755 $(INSTALL_DIR)/shellsec-complete
uninstall:
@echo Deleting shellsec...
@rm $(shell command -v shellsec)
@rm $(shell command -v shellsec-setkey)
@rm $(shell command -v shellsec-complete)
# inject bash auto completion for shellsec
complete:
@if [ -z "$(shell grep 'shellsec-complete' $(HOME)/.bashrc)" ]; then \
echo "\n# Added by shellsec" >> $(HOME)/.bashrc && echo ". $(shell command -v shellsec-complete)" >> $(HOME)/.bashrc; \
echo "Injected bash completion in your .bashrc at $(HOME)/.bashrc"; \
else \
echo "Bash completion is already injected in your .bashrc"; \
fi