forked from aniketpanjwani/chomper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
23 lines (20 loc) · 948 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Copyright: (c) 2018, Aniket Panjwani <[email protected]>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
.PHONY: lock reset
SHELL:=/bin/bash
INTERPRETER=$(shell pipenv --py)
CURRENT_USER:=$(shell whoami)
CURRENT_DIR:=$(shell pwd)
SUDOERS_FILE:=/etc/sudoers.d/chomper
SUDOERS_ENTRY_MIDDLE:=" ALL=(ALL) NOPASSWD: "
SUDOERS_ENTRY_SUFFIX:="/chomper/block.py *"
SUDOERS_ENTRY:=$(CURRENT_USER)$(SUDOERS_ENTRY_MIDDLE)$(INTERPRETER) $(CURRENT_DIR)$(SUDOERS_ENTRY_SUFFIX)
lock:
echo $(SUDOERS_ENTRY) | sudo EDITOR='tee' visudo -f $(SUDOERS_FILE)
sudo chown -R root:root ./
sudo chown $(CURRENT_USER):$(CURRENT_USER) ./data/rules.yaml
sudo chown $(CURRENT_USER):$(CURRENT_USER) ./readme.org
sudo chown $(CURRENT_USER):$(CURRENT_USER) ./.gitignore
sudo chown -R $(CURRENT_USER):$(CURRENT_USER) ./.git
reset:
sudo env PATH=$(PATH):/usr/sbin:/sbin ${INTERPRETER}3.6m ${CURRENT_DIR}/chomper/reset.py