Globals: Difference between revisions
No edit summary |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Minux uses a couple global variables to keep track of things. | Minux uses a couple global variables to keep track of things. | ||
these can be called by either the _G. prefix or without. | |||
'''Base OS variables: -''' all of these are part of minux-main | eg: ''print(_G.diskside)'' - prints the side the disk drive is found on, ''print(diskside)'' does the same thing | ||
'''Base OS variables: -''' all of these are part of minux-main and always available | |||
_G.modemside - string - the side the modem is found at, all but bottom. if none this string is "[NONE]". | _G.modemside - string - the side the modem is found at, all but bottom. if none this string is "[NONE]". | ||
Line 14: | Line 20: | ||
_G.printer - the printer, wrapped and ready to go. | _G.printer - the printer, wrapped and ready to go. | ||
_G.monitor - string - the monitor, wrapped and ready to go, see "/ | _G.monitor - string - the monitor, wrapped and ready to go, see "[[Api/dev|devlib]]" package for an example. | ||
_G.debugmode - string - the active debug mode, what should be done when minux.debug() is used. | _G.debugmode - string - the active debug mode, what should be done when minux.debug() is used. | ||
_G.expect - the "expect" function from base CC loaded and ready to be used. | |||
'''DHCP variables:''' | '''DHCP variables:''' | ||
_G.server - int - DHCP server ID, numerical value, the id of the DHCP server. | minux-main | _G.server - int - DHCP server ID, numerical value, the id of the DHCP server. | minux-main | ||
Line 32: | Line 41: | ||
'''AUTH variables:''' | '''AUTH variables:''' | ||
_G.login - string - current username, only used on networked systems, server always verifies every action, local verify trough file. | minux-main | _G.login - string - current username, only used on networked systems, server always verifies every action, local verify trough file. | minux-main |
Latest revision as of 15:08, 9 October 2024
Minux uses a couple global variables to keep track of things.
these can be called by either the _G. prefix or without.
eg: print(_G.diskside) - prints the side the disk drive is found on, print(diskside) does the same thing
Base OS variables: - all of these are part of minux-main and always available
_G.modemside - string - the side the modem is found at, all but bottom. if none this string is "[NONE]".
_G.diskside - string - side the disk drive is on, if none this string is "[NONE]". see "/bin/makeboot.sh" for an example.
_G.monitorside - string - side the monitor is on, if none this string is "[NONE]". see "/etc/minux-main/sys/monitorprint.sys" for an example.
_G.printerside - string - side the printer is on, if none this string is "[NONE]".
_G.printer - the printer, wrapped and ready to go.
_G.monitor - string - the monitor, wrapped and ready to go, see "devlib" package for an example.
_G.debugmode - string - the active debug mode, what should be done when minux.debug() is used.
_G.expect - the "expect" function from base CC loaded and ready to be used.
DHCP variables:
_G.server - int - DHCP server ID, numerical value, the id of the DHCP server. | minux-main
_G.authserver - int - AUTH server ID, numerical value, the id of the user account server. | minux-main
_G.lookupname - string - last dhcp lookup name result, requires auth-client. | auth-client
_G.lookupid - string - last dhcp lookup id result, requires auth-client. | auth-client
_G.lookupowner - string - last dhcp lookup owner result, requires auth-client. | auth-client
AUTH variables:
_G.login - string - current username, only used on networked systems, server always verifies every action, local verify trough file. | minux-main
_G.masterpass - string - current password, only used on networked systems, server always verifies every action, local verify trough file. | minux-main
_G.admin - bool - true or false, sets administrator rights, networked accounts get verified on the server. | minux-main
_G.validlogin - bool, true or false, passed last login/safety check, revokes user rights if failed, safety feature. | minux-main
_G.owner - bool - true or false, gives admin rights tied to system ownership, networked systems get verified on the server | auth-client
_G.ownergroup - string - this group has user access to this computer, false for no groups at all. | auth-client
_G.isgroupmember - bool true/false - used to check if current _G.login is a member of _G.ownergroup. | auth-client
_G.lockactive - bool true/false - locks the session if set true, unlocks if set false, part of BASH (V 1.1.1 or newer) | minux-main