ensure file size mb at least 1, fix shebang

master v1.19
bel 2021-07-15 19:18:47 -06:00
parent 69ac5f1cbf
commit 2d16bf0ad5
1 changed files with 6 additions and 3 deletions

View File

@ -7,11 +7,14 @@ import (
)
func getScript() string {
return strings.ReplaceAll(script, "{{{MAXSIZE}}}", fmt.Sprint(config.MaxSizeMB<<20))
maxSizeMB := config.MaxSizeMB
if maxSizeMB == 0 {
maxSizeMB = 1
}
return strings.ReplaceAll(script, "{{{MAXSIZE}}}", fmt.Sprint(maxSizeMB<<20))
}
const script = `
#!/bin/bash
const script = `#!/bin/bash
function main() {
local maxsize={{{MAXSIZE}}}
if [[ "$maxsize" == 0 ]]; then