Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- -- man pages start here
- local backup_help = [[
- backup - Make a complete copy of a computer
- ------------------------------------------
- USAGE: backup
- This program makes a nearly-exact copy of a computer, excluding its label.
- It saves every file/directory and its contents to the first disk inserted.
- This disk will be located at "disk/".
- This program must be run as root, or else it will crash.
- ]]
- local programs_help = [[
- Program List:
- logviewer
- sudo
- su
- adduser
- systeminfo
- whoami
- protect
- diskinfo
- man
- deluser
- changepassword
- ]]
- local api_help = [[
- API Functions:
- museOS.switchUser(string target, string password)
- museOS.sudo(string rootpw, string program, args)
- museOS.getUserID()
- museOS.getUsers()
- museOS.authenticate(string user, string password)
- authenticate: provides password authentication
- sudo: Similar to shell.run, but runs programs as root
- getUserID: returns the current user's userID
- getUsers: returns a list of users
- switchUser: switches the current user
- All functions can be run without root access.
- ]]
- local turtleSettings_help = [[
- turtleSettings - change settings on turtles
- ------------------------------------------
- This program allows the superuser to change the systemwide turtle settings.
- These settings can change:
- If the turtle is allowed to move
- If the turtle is allowed to place blocks
- If the turtle is allowed to break blocks
- If the turtle is allowed to suck up blocks
- This program must be run as root!
- ]]
- local updater_help = [[
- updater - update MuSeOS
- ------------------------------------------
- USAGE: updater
- This program allows the superuser to update MuSeOS to the latest version.
- This program will not run if MuSeOS is already at the latest version.
- You need to be root to run this!
- ]]
- local logviewer_help = [[
- logViewer - view system logs
- ------------------------------------------
- USAGE: logviewer [target log]
- This program allows the superuser to view logs that have been made by the OS.
- Default logs are:
- OSLog - Security and Users
- fileLog - File Operations
- RSLog - Redstone Operations
- HTTTPLog - HTTP Operations
- RednetLog - Rednet Transmissions
- TurtleLog - Turtle Operations (if applicable)
- This program must be run as root!
- ]]
- local sudo_help = [[
- sudo - run programs as root
- ------------------------------------------
- USAGE: sudo [root pw] [program] [arguments]
- This program launches a program as root.
- This program will refuse to function if you are already root.
- ]]
- local adduser_help = [[
- addUser - add a user
- ------------------------------------------
- USAGE: adduser [username] [password]
- This program adds a new user to the system.
- This user will have normal priviledges.
- This program must be run as root!
- ]]
- local systeminfo_help = [[
- systemInfo - display system information
- ------------------------------------------
- USAGE: systeminfo
- This program displays the following:
- MuSeOS Version
- Computer ID
- Computer Label
- If this program is run as root, the following is also displayed:
- OSLog file size
- fileLog file size
- RSLog file size
- HTTPLog file size
- RednetLog file size
- ]]
- local whoami_help = [[
- whoami - displays user info
- ------------------------------------------
- USAGE: whoami
- This program displays the username of the current user and his/her user ID.
- ]]
- local protect_help = [[
- protect - protects a folder from modification
- ------------------------------------------
- USAGE: protect [path/to/folder]
- This program adds a folder to the protected folders file, ensuring that the OS blocks all attempts
- to access the file.
- Protected folders can still be accessed by root, though.
- This program must be run as root!
- ]]
- local deluser_help = [[
- delUser - delete a user
- ------------------------------------------
- USAGE: deluser [target]
- This program deletes a user, their program settings folder, and their home folder.
- This program is irreversible!
- This program must be run as root!
- ]]
- local su_help = [[
- su - switch users
- ------------------------------------------
- USAGE: su [target user] [password]
- This program allows a user to switch to another user's account, provided they know the target user's password.
- ]]
- local changepassword_help =[[
- changepassword - change a user's password
- ------------------------------------------
- USAGE:changepassword [target user] [old password] [new password]
- This program allows root to change a user's password, provided they know that user's current password.
- This program must be run as root!
- ]]
- local diskinfo_help = [[
- diskinfo - show disk information
- ------------------------------------------
- USAGE: diskinfo [side]
- This program shows information on the disk inserted in [side].
- Information shown:
- Has Data/Has Music
- Mount Path (if applicable)
- Disk Label (if applicable)
- Disk ID (if applicable)
- Audio Title (if applicable)
- You can also play music with This program, just press ENTER.
- To eject the inserted disk, press SPACE.
- To exit, press any key other than ESCAPE.
- ]]
- local man_help = [[
- man - MuSeOS manual
- ------------------------------------------
- USAGE: man [command]
- This program shows usage information and other things.
- It shows:
- Arguments that must be passed to the program
- How to use a program
- What the program does
- Notes
- ]]
- -- man pages end here
- local function man()
- local maxX, maxY = term.getSize()
- term.clear()
- term.setCursorPos(1,1)
- topic = string.lower(args[1])
- if topic == "logviewer" then
- io.write(logviewer_help)
- elseif topic == "sudo" then
- io.write(sudo_help)
- elseif topic == "su" then
- io.write(su_help)
- elseif topic == "whoami" then
- io.write(whoami_help)
- elseif topic == "protect" then
- io.write(protect_help)
- elseif topic == "deluser" then
- io.write(deluser_help)
- elseif topic == "changepassword" then
- io.write(changepassword_help)
- elseif topic == "diskinfo" then
- io.write(diskinfo_help)
- elseif topic == "adduser" then
- io.write(adduser_help)
- elseif topic == "systeminfo" then
- io.write(systeminfo_help)
- elseif topic == "api" then
- io.write(api_help)
- elseif topic == "programs" then
- io.write(programs_help)
- elseif topic == "updater" then
- io.write(updater_help)
- elseif topic == "turtlesettings" and turtle then
- io.write(turtleSettings_help)
- elseif topic == "backup" then
- io.write(backup_help)
- else
- io.write(man_help)
- end
- term.setCursorPos(1,maxY)
- io.write("Press any key to exit.")
- os.pullEvent("key")
- end
- if #args == 1 then
- man()
- else
- args[1] = "man"
- man()
- end
- term.clear()
- term.setCursorPos(1,1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement