Compare commits
4 Commits
4d81d4f5dd
...
29f71266b3
Author | SHA1 | Date |
---|---|---|
Emmanuel Garette | 29f71266b3 | |
Emmanuel Garette | 58370148bc | |
Emmanuel Garette | 932fbc18e2 | |
Emmanuel Garette | 4708a16bdf |
|
@ -31,7 +31,7 @@ verif() {
|
||||||
for V in creole.reseau.unbound_route_address creole.reseau.unbound_domain_name creole.serveur_dns.unbound_local_zones creole.reseau.unbound_ip_address_cidr; do
|
for V in creole.reseau.unbound_route_address creole.reseau.unbound_domain_name creole.serveur_dns.unbound_local_zones creole.reseau.unbound_ip_address_cidr; do
|
||||||
i=$((i+1))
|
i=$((i+1))
|
||||||
R=$(cucchiaiata-cli setting.session.$1.get -s $S -n $V | jq -Mcr .content[])
|
R=$(cucchiaiata-cli setting.session.$1.get -s $S -n $V | jq -Mcr .content[])
|
||||||
[ $R = "${argv[i]}" ]
|
[ "$R" = "${argv[i]}" ]
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ cucchiaiata-cli setting.template.generate -s dns.cadoles.com
|
||||||
cucchiaiata-cli setting.servermodel.dependency.add -m aca -a openssh -o cadoles -e last
|
cucchiaiata-cli setting.servermodel.dependency.add -m aca -a openssh -o cadoles -e last
|
||||||
S=$(cucchiaiata-cli setting.session.server.start -s dns.cadoles.com | jq -r .session_id)
|
S=$(cucchiaiata-cli setting.session.server.start -s dns.cadoles.com | jq -r .session_id)
|
||||||
R=$(cucchiaiata-cli setting.session.server.get -s $S -n creole.serveur_ssh.ssh_allow_networks | jq -Mcr .content[])
|
R=$(cucchiaiata-cli setting.session.server.get -s $S -n creole.serveur_ssh.ssh_allow_networks | jq -Mcr .content[])
|
||||||
[ $R = "[]" ]
|
[ "$R" = "[]" ]
|
||||||
cucchiaiata-cli setting.session.server.stop -s $S
|
cucchiaiata-cli setting.session.server.stop -s $S
|
||||||
|
|
||||||
S=$(cucchiaiata-cli setting.session.servermodel.start -m aca -e last| jq -r .session_id)
|
S=$(cucchiaiata-cli setting.session.servermodel.start -m aca -e last| jq -r .session_id)
|
||||||
|
@ -122,7 +122,7 @@ cucchiaiata-cli setting.session.servermodel.stop -s $S -a
|
||||||
|
|
||||||
S=$(cucchiaiata-cli setting.session.server.start -s dns.cadoles.com | jq -r .session_id)
|
S=$(cucchiaiata-cli setting.session.server.start -s dns.cadoles.com | jq -r .session_id)
|
||||||
R=$(cucchiaiata-cli setting.session.server.get -s $S -n creole.serveur_ssh.ssh_allow_networks | jq -Mcr .content[])
|
R=$(cucchiaiata-cli setting.session.server.get -s $S -n creole.serveur_ssh.ssh_allow_networks | jq -Mcr .content[])
|
||||||
[ $R = '["admin.cadoles.com"]' ]
|
[ "$R" = '["admin.cadoles.com"]' ]
|
||||||
cucchiaiata-cli setting.session.server.stop -s $S
|
cucchiaiata-cli setting.session.server.stop -s $S
|
||||||
|
|
||||||
# Regenerate configuration
|
# Regenerate configuration
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/python3
|
||||||
"""Zephir-cmd-input script
|
"""Zephir-cmd-input script
|
||||||
"""
|
"""
|
||||||
from sys import exit, argv
|
from sys import exit, argv
|
||||||
|
@ -10,8 +10,8 @@ from cucchiaiata.i18n import _
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
try:
|
try:
|
||||||
if argv[1] in ['setting.session.server.configure',
|
if len(argv) > 2 and argv[1] in ['setting.session.server.configure',
|
||||||
'setting.session.servermodel.configure']:
|
'setting.session.servermodel.configure']:
|
||||||
Configuration().get()
|
Configuration().get()
|
||||||
else:
|
else:
|
||||||
parser = Parser()
|
parser = Parser()
|
||||||
|
|
|
@ -26,10 +26,10 @@ version: {version}"""
|
||||||
config = load(stream, Loader=SafeLoader)
|
config = load(stream, Loader=SafeLoader)
|
||||||
except YAMLError as err:
|
except YAMLError as err:
|
||||||
raise Exception(_('Error when creating the config file {}').format(err))
|
raise Exception(_('Error when creating the config file {}').format(err))
|
||||||
|
|
||||||
self.url = config['url']
|
self.url = config['url']
|
||||||
self.version = config['version']
|
self.version = config['version']
|
||||||
self.debug = 'debug' in config
|
self.debug = config.get('debug', False)
|
||||||
self.remote_url = 'http://{}/api/{}'.format(self.url, self.version)
|
self.remote_url = 'http://{}/api/{}'.format(self.url, self.version)
|
||||||
self.token_file = join(expanduser("~"), '.zephir-client.jwt.token')
|
self.token_file = join(expanduser("~"), '.zephir-client.jwt.token')
|
||||||
self.indent = config.get('indent', 2)
|
self.indent = config.get('indent', 2)
|
||||||
|
|
Loading…
Reference in New Issue