ShadowArch/ShadowArch/Makefile

43 lines
2.0 KiB
Makefile
Raw Normal View History

2016-11-16 16:23:52 -06:00
HTTPROOT = /srv/http/aninix.net
2016-08-04 12:30:21 -05:00
HTTPUSER = http
SYNCLIST = /etc/vimrc /etc/bash.bashrc /etc/skel /etc/tmux.conf
2017-06-19 16:36:22 -05:00
INSTALLER != curl -s https://aninix.net/foundation/installer-test.bash | /bin/bash
2016-08-04 12:30:21 -05:00
2016-08-30 14:20:55 -05:00
compile:
2017-06-19 16:36:22 -05:00
[ -f ./shadowarch ]
2016-08-30 14:20:55 -05:00
2017-06-19 16:36:22 -05:00
install: compile
cp ./vimrc /etc/vimrc
cp bash.bashrc /etc/bash.bashrc
2017-05-27 16:38:14 -05:00
rsync -avz -r skel/ /etc/skel
cp tmux.conf /etc/tmux.conf
2016-08-04 12:30:21 -05:00
repository: shadowarch
cp ./shadowarch ${HTTPROOT}
2016-11-16 16:23:52 -06:00
checkperm: ${SYNCLIST}
2017-05-02 11:20:06 -05:00
printf "What is your deprivileged user? "; read user; chown -R ${user}:${user} .
if [ -f ${HTTPROOT}/shadowarch ]; then chmod 0755 ${HTTPROOT}/shadowarch; chown ${HTTPUSER} ${HTTPROOT}/shadowarch; fi
chown -R root:root ${SYNCLIST}
for i in ${SYNCLIST}; do if [ -f "${i}" ]; then chmod 0644 "${i}"; elif [ -d "${i}" ]; then chmod 0755 "${i}"; fi; done
2016-08-04 12:30:21 -05:00
2016-11-16 16:23:52 -06:00
test:
2016-11-29 15:00:15 -06:00
bash -n shadowarch
bash ./shadowarch -h
echo Success.
reverse: ${HTTPROOT}/shadowarch ${SYNCLIST}
cat ${HTTPROOT}/shadowarch > ./shadowarch
for i in ${SYNCLIST}; do rsync -avz ${SYNCLIST} .; done
2016-08-04 12:30:21 -05:00
2017-06-19 16:36:22 -05:00
clean:
@echo Nothing to do.
2017-05-27 16:38:14 -05:00
diff: ${HTTPROOT}/shadowarch ${SYNCLIST}
2017-06-19 16:36:22 -05:00
diff ./shadowarch ${HTTPROOT}/shadowarch
2017-05-27 16:38:14 -05:00
for i in ${SYNCLIST}; do diff "${i}" ./`echo ${i} | rev | cut -f 1 -d '/' | rev` || [ 1 -eq 1 ]; done
find-missing-hooks-in-src:
@for i in `wget -q -O - https://aninix.net/foundation/ | grep toplevel-repo | cut -f 4 -d \'`; do if [ -z $$i ]; then continue; fi; for file in `find ../.. -type f -name Makefile | grep $$i`; do if [ -z "$$file" ]; then echo NO MAKEFILE FOR $$i; elif [ `grep -c -i 'hook for systemd' $$file` -eq 0 ]; then echo HOOK MISSING IN: $$file; else echo HOOK FOUND IN: $$file; fi; done; done
@for i in `wget -q -O - https://aninix.net/foundation/ | grep toplevel-repo | cut -f 4 -d \'`; do if [ -z $$i ]; then continue; fi; for file in `find ../.. -type f -name Makefile | grep $$i`; do if [ -z "$$file" ]; then echo NO MAKEFILE FOR $$i; elif [ `grep -c useradd $$file` -eq 0 ]; then echo DEPRIV MISSING IN: $$file; else echo DEPRIV FOUND IN: $$file; fi; done; done