index
Minux developer information
contents:
1 - file functions
2 - table functions
3 - system functions
4 - user functions
5 - configuration functions
6 - mapt manager - mapt software manager, package management
1 - file functions
minux.countline
counts the lines in target file and returns the count.
example: data = minux.countline("/testfile.txt")
input1: target file path as string
output: file line count as number, false if file not found
minux.findline
searches for target string in a file and returns line number where target is found
it will return the linenumber if a part of a line matches the search string
example: data = minux.findline("/testfile.txt", "teststring")
input1: target file to search in as string
input2: target string to search for as string
output: target line as number, false if not found
minux.filecontains
searches for EXACT string in target file and returns the line number
the entire line must be that exact string, not part of the line
example: data = minux.filecontains("/testfile.txt","teststring")
input1: target file path as string
input2: target string to search for as string
output: target line as number, false if not found
minux.printline
returns a specific line from a target file
example: data = minux.printline("/testfile",5)
input1: target file path as string
input2: target line as number
output: contents of target line in target file, or false if file/line not found
minux.removestring
looks for a string in a file and removes the line it is on
example: data = minux.removestring("/testfile","teststring")
input1: path to target file as string
input2: target string to remove
output: true if the line is removed, false if not
minux.replaceline
replaces a line in a file containing target string with new line data
example: data = minux.replaceline("/testfile","oldstring","newstring")
input1: target file path as string
input2: old string as string
input3: new string as string
output: true if replaced, false if not
minux.insertline
inserts a line to the back of a file, creates new file if target file doesn't exist
example: data = minux.insertline("/testfile","teststring")
input1: path to target file as string
input2: string to add as string
output: true if added, false if not
minux.download
downloads a file and returns output rather then prints, it also verifies if a download happened.
example: data = minux.download(adress, "/testfile")
input1: full url adress of target file as string
input2: path to store target file as string
output: true on success or false on fail.
minux.findfile
searches the disk for a file, returns the search results as a table
example: data = minux.findfile("testfile.lua")
input1: target file to search for
output: search results as a table, first entry will be "noresult" if not found.
minux.lsr
recursively lists a folder and returns it as a table
example: data = minux.lsr("/testfolder/")
input1: target folder to list as string
output: recursive file list of target folder or false if not found
minux.lsa
detailed file list of a folder and returns as a table
example: data = minux.lsa("/testfolder/")
input1: target folder to list
output: detailed file list of target folder or false if not found
minux.findchar
finds a character in a string
example: minux.findchar(string,target)
input1: string - string to search trough
input2: string - target character to find
output: location of character in the string as number
minux.getconf
searches target file for config value and returns what is after "="
example: minux.getconf(file,target)
input1: string - file to search trough
input2: string - target configuration
output: either false if not found or whatever is behind "=" as string
2 - table functions
minux.writetable
writes a memory table as a file
example: minux.writetable("/testfile",testtable)
input1: path to target file as string
input2: target table as a table
output: never fails, always returns true
minux.readtable
reads a file as a table
example: data = minux.readtable("/testfile")
input1: path to target file as string
output: file contents as a table or false if file not found
minux.tablecontains
searches a table if it contains a string
example: data = minux.tablecontains(testtable, "teststring")
input1: target table as table
input2: target string as string
output: table field number target string is found at or false if not found
minux.tablecount
counts the amount of fields in a table
example: data = minux.tablecount(testtable)
input1: target table as a table
output: table field count as number
3 - system functions
minux.halt()
properly shuts down the system
example: minux.halt()
minux.restart()
properly restarts the system
example: minux.restart()
minux.rng
generates a random number
example: data = minux.rng(number)
input1: a number to scramble the rng even more, can be either number or nil (optional)
output: a random number as number
minux.disableoutput
disables screen output
example: minux.disableoutput()
minux.enableoutput
enables screen output
example: minux.enableoutput()
minux.perfind()
searches for an external device and returns the side it's on
example: data = minux.perfind("disk")
output: side it's on or "NONE" as a string
type can be any CC device like printers or diskdrives.
minux.monitorprint
prints a line on the monitor in stead of screen
example: minux.monitorprint("teststring")
input1: target text as string
output: true if printed, false if not
minux.log
creates a log file entry
example: minux.log("logfile","logtext","loglevel")
input1: log file name as string
input2: log entry text as string
input3: log level as number
output: false if error, true if success.
success means writing the log according to system settings, if _G.logmode >= "loglevel" then write.
log level 0 = disabled, 1 = error, 2 = warning, 3 = debug
4 - login/auth functions - these are here for reference, these only work on local minux auth.
minux.login
log in to the auth system
example: data = minux.login("foo","bar")
input1: username as string
input2: password as string
output: true if allowed and false if not, also sets memory values if allowed.
minux.useradd
creates a new user
example: data = minux.useradd("user","pass")
input1: username as a string
input2: password as a string
output: number: 200 if allowed, other code if not
minux.userdel
removes a user
example: data = minux.userdel("user")
input1: username as a string
output: number: 200 if allowed, other code if not
minux.passwd
changes a user's password
example: data = minux.passwd("user","pass")
input1: username as string
input2: password as string
output: number: 200 if changed, other code if not
minux.saveuser
saves a users's login data, usefull for remembering login for servers.
example: data = minux.saveuser()
output: table containing user data to feed to restoreuser()
minux.restoreuser
restores a user's login data from previously saved information,
example: minux.restoreuser(data)
input1: table you got from saveuser
output: sets user data back
5 - configuration functions
minux.setlogin
changes login mode
example: data = minux.setlogin(setting)
input1: true or false as a string
output: number: 300 if changed, other code if not
minux.setshell
changes default system shell
example: data = minux.setshell(path)
input1: path to shell script as string
output: number: 300 if changed, other code if not
minux.setui
changes default user ui
example: data = minux.setui(path)
input1: path to ui/shell script as string
output: number: 300 if changed, other code if not
minux.setsui
changes default system ui
example: data = minux.setsui(path)
input1: path to ui/shell script as string
output: number: 300 if changed, other code if not
minux.setlogpath
changes system log file directory
example: data = minux.setlogpath(path)
input1: path to new log file directory
output: number: 300 if changed, other code if not
minux.setlogmode
enables or disables log file creation
example: data = minux.logmode(setting)
input1: true or false as string
output: number:300 if changed, other code if not
minux.setmaptsource
changes mapt source file location
example: data = minux.setmaptsource(path)
input1: path to new file as string
output: number: 300 if changed, other code if not
minux.setmaptinstalled
changes mapt installed programs list
example: data = minux.setmaptinstalled(path)
input1: path to new file as string
output: number: 300 if changed, other code if not
minux.setuserdata
changes user login data location
example: data = minux.setuserdata(path)
input1: path to new directory as string
output: number: 300 if changed, other code if not
minux.setupdate
changes auto update setting
example: data = minux.setupdate(count)
input1: amount of boots to skip as string, 0 = disabled
output: number: 300 if changed, other code if not
minux.setauthsys
changes default login/auth system
example: data = minux.setauthsys(path)
input1: path to new file as string
output: number: 300 if changed, other code if not
minux.setcolor
changes system color, user setting
example: data = minux.setcolor(o1,o2)
input1: string, can be tc(text color),bc(background color) and sc(system/prompt color)
input2: string, white,orange,magenta,lightBlue,yellow,lime,pink,gray,lightGray,cyan,purple,blue,brown,green,red,black
output: number: 100 if success, 101 if wrong input1, 102 if wrong input2
minux.setsyscolor
changes system color, system wide default setting
example: data = minux.setsyscolor(o1,o2)
input1: string, can be tc(text color),bc(background color) and sc(system/prompt color)
input2: string, white,orange,magenta,lightBlue,yellow,lime,pink,gray,lightGray,cyan,purple,blue,brown,green,red,black
output: number: 100 if success, 101 if wrong input1, 102 if wrong input2
minux.loadconfig
loads configuration values
example: data = minux.loadconfig()
output: retrieves and sets memory values for config.
minux.tuccs
prints "tuccs" on the screen
example: data = minux.tuccs()
output: prints tuccs on the screen
minux.getconf
reads a file for a string and a marker, returns what is after the marker
example: data = minux.getconf(file,"shell","=")
input1: file to search trough
input2: string to search for
input3: marker to start reading from
output: everything behind the marker
6 - mapt functions
mapt.install
installs a package
example: data = mapt.install("pack")
input1: package name as string
output: number: 100 if installed, other code if not
mapt.remove
removes a package
example: data = mapt.remove("pack")
input1: package name as string
output: number: 100 if removed, other code if not
mapt.update
runs a package or system update
example: data = mapt.update("pack")
input1: nill for full check, package name for specific check or "force" for forced update/reinstall
output: number: 100 if success, other code if not
mapt.addsource
installs a package repository source
example: data = mapt.addsource(url)
input1: source url as string
output: number: 100 if installed, other code if not
mapt.removesource
removes a package repository source
example: data = mapt.removesource(url)
input1: source url as string
output: number: 100 if installed, other code if not
mapt.bootbuild
rebuilds init1 and init2 files
example: data = mapt.bootbuild()
output: number: 100 if installed, other code if not
mapt.checkinstall
checks if a package is installed
example: data = mapt.checkinstall(packname)
input1: string, packname, name of the package to find
output: bool, true if found, false if not.