Commit 4ddbd5ff authored by Björn's avatar Björn

adding #11 #12

parent 6d59ab8e
......@@ -33,6 +33,17 @@ export SMTP_TO=""
## Commands
### Backup
```bash
sources=/home/herrhase/Downloads
exclude=
remote_host=test@192.168.56.210
remote_target=backup/der
gpg_key_id=
gpg_passphrase=
remove_all_but_n_full=10
```
### Storagebox
If you use a storagebox from Hetzner you can add and remove SSH-Keys with,
......
import configparser
import os
from termcolor import colored
#
#
......@@ -20,6 +23,18 @@ class Config:
else:
config = self._args.config
# check that config-file exits
if (os.path.exists(config) == False):
print(colored(config + ' not found!', 'yellow'))
print(colored('Failed! Exit Script!', 'red'))
exit()
# check that config-file chmod is 0600
if (oct(os.stat(config).st_mode)[4:] != '0600'):
print(colored('chmod of ' + config + ' has to be 600', 'yellow'))
print(colored('Failed! Exit Script!', 'red'))
exit()
self._config = configparser.RawConfigParser(allow_no_value=True)
self._config.read_file(open(config))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment