Skip to content
Snippets Groups Projects
50-config 858 B
Newer Older
  • Learn to ignore specific revisions
  • Griefed's avatar
    Griefed committed
    #!/usr/bin/with-contenv bash
    
    
    # Check if configs are provided by host, if not, use defaults
    if [ ! -f "/config/discord-config.json" ]; then
    	cp /defaults/discord-config.json /config/discord-config.json
    fi
    
    if [ ! -f "/config/misc-config.json" ]; then
    
    Griefed's avatar
    Griefed committed
      cp /defaults/misc-config.json /config/misc-config.json
    
    Griefed's avatar
    Griefed committed
    fi
    
    if [ ! -f "/config/socket-config.json" ]; then
    
    Griefed's avatar
    Griefed committed
      cp /defaults/socket-config.json /config/socket-config.json
    
    Griefed's avatar
    Griefed committed
    fi
    
    # Overwrite config files in d-zone directory
    ln -sf /config/discord-config.json /app/d-zone/discord-config.json
    ln -sf /config/misc-config.json /app/d-zone/misc-config.json
    ln -sf /config/socket-config.json /app/d-zone/socket-config.json
    
    # permissions stuff
    chown -R abc:abc \
    	/config
    
    # chwon the app directory, but not node_modules
    find /app/d-zone -maxdepth 1 ! -name node_modules ! -name d-zone -exec chown -R abc:abc '{}' \;