Beispiel #1
0
def enable(site):
    """ Creates symlink from sites-available to sites-enabled """
    available = "/etc/nginx/sites-available/{site}".format(site=site)
    enabled = "/etc/nginx/sites-enabled/{site}".format(site=site)
    command = "ln -s {available} {enabled}".format(
        available=available, enabled=enabled)
    system.system_command(command, sudo)
Beispiel #2
0
def disable(site):
    """ Removes symlink from sites-enabled """
    enabled = "/etc/nginx/sites-enabled/{site}".format(site=site)
    command = "rm {enabled}".format(enabled=enabled)
    system.system_command(command, sudo)
Beispiel #3
0
def sites():
    """Display nginx enabled sites"""
    command = 'ls -la /etc/nginx/sites-enabled'
    system.system_command(command, sudo)
Beispiel #4
0
def set(key, value):
    """ Set cache value stored @ key """
    command = "redis-cli SET {key} {value}".format(key=key, value=value)
    system.system_command(command, sudo)
Beispiel #5
0
def get(key):
    """ Get cache value stored @ key """
    command = "redis-cli GET {key}".format(key=key)
    system.system_command(command, sudo)
Beispiel #6
0
def flush():
    """ Flushes caches """
    command = 'redis-cli FLUSHALL'
    system.system_command(command, sudo)