Compare commits
No commits in common. "22b968a321764b2dc8bdc52e1e12bb337dc4041e" and "ccf13e8780862948066642f99a68657938ef1663" have entirely different histories.
22b968a321
...
ccf13e8780
5 changed files with 4 additions and 61 deletions
|
@ -4,7 +4,7 @@
|
||||||
export BORG_REPO=/srv/data/backup/borg/homeserver
|
export BORG_REPO=/srv/data/backup/borg/homeserver
|
||||||
|
|
||||||
# See the section "Passphrase notes" for more infos.
|
# See the section "Passphrase notes" for more infos.
|
||||||
export BORG_PASSPHRASE="$(cat /root/secret/borg/borg-homeserver.key)"
|
export BORG_PASSPHRASE="$(cat /root/secret/borg-homeserver.key)"
|
||||||
|
|
||||||
# some helpers and error handling:
|
# some helpers and error handling:
|
||||||
info() { printf "\n%s %s\n\n" "$( date )" "$*" >&2; }
|
info() { printf "\n%s %s\n\n" "$( date )" "$*" >&2; }
|
||||||
|
|
|
@ -19,8 +19,7 @@ borg check -v data/backup/borg/snowboard
|
||||||
status_check=$?
|
status_check=$?
|
||||||
echo "finished checking the downloaded repo. Status: $status_check"
|
echo "finished checking the downloaded repo. Status: $status_check"
|
||||||
if [ "$status_check" -eq "0" ]; then
|
if [ "$status_check" -eq "0" ]; then
|
||||||
cd $REPO_ROOT
|
chown fileserver:fileserver $REPO_DIR/$backupdir
|
||||||
chown fileserver:fileserver $backupdir
|
|
||||||
rm -r old
|
rm -r old
|
||||||
else
|
else
|
||||||
echo "the new repo was not checked successfully, keeping old repo."
|
echo "the new repo was not checked successfully, keeping old repo."
|
||||||
|
|
30
mail-script
30
mail-script
|
@ -1,30 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
from email.message import EmailMessage
|
|
||||||
import sys
|
|
||||||
|
|
||||||
if sys.argv[1] == "--help" or sys.argv[1] == "-h" or sys.argv[1] == "":
|
|
||||||
print("""
|
|
||||||
This is just a hacked together python script from stackoverflow that can be used to add a proper
|
|
||||||
MIME header for file attachments to a mail. Pipe the outpit to sendmail -oi -t to send.
|
|
||||||
|
|
||||||
usage:
|
|
||||||
mail-script "from@email.com" "to@email.com" "subject" /file/to/append < /body/of/mail | sendmail -oi -t
|
|
||||||
""")
|
|
||||||
exit(0)
|
|
||||||
|
|
||||||
msg = EmailMessage()
|
|
||||||
msg['From'] = sys.argv[1]
|
|
||||||
msg['To'] = sys.argv[2]
|
|
||||||
msg['Subject'] = sys.argv[3]
|
|
||||||
# Don't mess with the preamble, the documentation is wrong to suggest you do
|
|
||||||
|
|
||||||
msg.set_content(''.join([line for line in sys.stdin]))
|
|
||||||
|
|
||||||
with open(sys.argv[4], 'r') as attachment:
|
|
||||||
#msg.add_attachment(attachment.read(), maintype='text', subtype='plain')
|
|
||||||
asStr = attachment.read()
|
|
||||||
asBytes = asStr.encode('utf-8')
|
|
||||||
msg.add_attachment(asBytes, maintype='application', subtype='octet-stream', filename="appendix.txt")
|
|
||||||
|
|
||||||
print(msg.as_string())
|
|
|
@ -1,25 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
TARGET=/var/run/docker-snowboard.socket
|
|
||||||
MAX_FAILS=10
|
|
||||||
SLEEP_TIME=2
|
|
||||||
|
|
||||||
echo "removing $TARGET"
|
|
||||||
rm /var/run/docker-snowboard.sock -rf
|
|
||||||
echo "relaying snowboards socket with ssh"
|
|
||||||
ssh -nNT -L /var/run/docker-snowboard.sock:/var/run/docker.sock root@cscherr.de &
|
|
||||||
|
|
||||||
# check if the target is a socket, and adjust it.
|
|
||||||
for ((i=0; i<=MAX_FAILS; i++)); do
|
|
||||||
if [[ $(file -b /var/run/docker-snowboard.sock) = 'socket' ]]; then
|
|
||||||
set -e
|
|
||||||
echo "$TARGET is a socket, adjusting permissions"
|
|
||||||
chmod 660 /var/run/docker-snowboard.sock
|
|
||||||
chgrp docker /var/run/docker-snowboard.sock
|
|
||||||
exit 0 # good end
|
|
||||||
else
|
|
||||||
echo "$i: $TARGET is not a socket"
|
|
||||||
fi
|
|
||||||
sleep $SLEEP_TIME
|
|
||||||
done
|
|
||||||
echo "$TARGET is not a socket even after waiting"
|
|
||||||
exit 1 # bad end
|
|
|
@ -1,5 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
tailscale up \
|
tailscale up \
|
||||||
--login-server https://vpn.cscherr.de \
|
--timeout 30s \
|
||||||
--advertise-exit-node \
|
--login-server https://vpn.cscherr.de \
|
||||||
--accept-risk=lose-ssh
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue