Aether/Makefile
DarkFeather 00f5dcc8f3 Fixes
2016-11-09 22:29:17 -06:00

72 lines
2.0 KiB
Makefile

SHELL := /bin/bash
BACKUPDIR := /usr/local/backup
compile:
pacman -S openssl gzip tar openssh
make keys
install:
@echo You must specify client or server in a call to make.
client: user aether.bash
cp aether.bash /home/aether/aether.bash
chown aether /home/aether/aether.bash
chmod 0700 /home/aether/aether.bash
/home/aether/aether.bash
crontab -l > /tmp/cronie
grep aether.bash /tmp/cronie || echo '0 1 * * * /home/aether/aether.bash &>> /var/log/aether.log' >> /tmp/cronie
crontab /tmp/cronie
rm /tmp/cronie
touch /var/log/aether.log
chown aether:aether /var/log/aether.log
server: scripts user ./aether-gen.bash ./aether.pub ./server-backup
bash ./aether-gen.bash
cp ./aether.pub /home/aether/.ssh/authorized_keys
chmod 0600 /home/aether/.ssh/authorized_keys
chown aether /home/aether/.ssh/authorized_keys
mkdir /usr/local/etc/Aether
chown aether /usr/local/etc/Aether
chmod 0700 /usr/local/etc/Aether
touch /usr/local/etc/Aether/nodeslist
@echo You have the files. Add aether-gen.bash and server-backup to root's crontab.
@echo Track client nodes in /usr/local/etc/Aether/nodeslist
user: aether make-user.bash
/bin/bash ./make-user.bash
tar: aether.bash aether make-user.bash
tar cvf aether.tar aether.bash aether Makefile make-user.bash
gzip aether.tar
node-command:
@echo -ne 'bzr checkout bzr://aninix.net/Aether'
@echo
@echo -ne 'cd Aether; cat > aether # Paste the private key'
@echo
@echo -ne 'make client'
@echo
keys:
ssh-keygen -t rsa -P "" -f aether
scripts: ./server-backup ./remote-backup
cp ./server-backup /root/bin
chmod 0700 /root/bin/server-backup
cp ./remote-backup /root/bin
chmod 0700 /root/bin/remote-backup
reverse:
cp /root/bin/server-backup .
cp /root/bin/remote-backup .
checkperm:
chmod 0700 /root/bin/remote-backup /root/bin/remote-backup
chown root:root /root/bin/server-backup /root/bin/remote-backup
chmod -R 0700 /usr/local/etc/Aether
chown -R aether:aether /usr/local/etc/Aether
chown postgres:root ${BACKUPDIR}
chmod 0770 ${BACKUPDIR}