mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-03 17:14:08 +02:00
36 lines
842 B
Text
Executable file
36 lines
842 B
Text
Executable file
#!/bin/nu
|
|
|
|
touch /var/log/nginx/access.log
|
|
touch /var/log/nginx/error.log
|
|
touch /var/log/cron/owncloud.log
|
|
|
|
cp /etc/nc/config.php /var/www/html/config/config.php
|
|
chmod 0755 /var/www/html/config/config.php
|
|
|
|
let configName = match $env.SQL {
|
|
"oracle" => "oci"
|
|
_ => $env.SQL
|
|
|
|
}
|
|
let configPath = $"/etc/nc/autoconfig_($configName).php"
|
|
|
|
if ($configPath | path exists) {
|
|
cp $configPath /var/www/html/config/autoconfig.php
|
|
}
|
|
|
|
def loadExtraConfig [name: string] {
|
|
sed -i $'/\/\/PLACEHOLDER/ r /etc/nc/($name).php' /var/www/html/config/config.php
|
|
}
|
|
|
|
let extraConfigs = ["S3", "S3S", "S3MB", "S3M", "SWIFT", "SWIFTV3", "AZURE"];
|
|
$extraConfigs | each {
|
|
if ($in in $env) {
|
|
loadExtraConfig ($in | str downcase)
|
|
}
|
|
}
|
|
|
|
if ("REDIS_TLS" in $env) {
|
|
loadExtraConfig "redis-tls"
|
|
} else {
|
|
loadExtraConfig "redis-default"
|
|
}
|