blob: 872662a99ad2c3742c1450cb55dc79a929c75324 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
## CGI script installation tool for kapsi.fi.
import os
import strformat
import strutils
proc modifyPath(s: string): string =
result = s.replace("/home/users", "/var/www/userhome")
let
updateDatabasePath = modifyPath(getAppDir() / "update_database")
scriptPath = paramStr(1)
script = &"""
#!/bin/sh
{updateDatabasePath}
"""
writeFile(scriptPath, script)
let fpExec = {fpUserExec, fpGroupExec, fpOthersExec}
setFilePermissions(scriptPath, getFilePermissions(scriptPath) + fpExec)
|