mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-14 01:39:36 -04:00
Merge branch 'master-MC1.7.10' of github.com:MightyPirates/OpenComputers into master-MC1.8
This commit is contained in:
commit
669526c6c1
@ -0,0 +1,20 @@
|
||||
local args = {...}
|
||||
if args[1] then
|
||||
local file, reason = io.open("/etc/hostname", "w")
|
||||
if not file then
|
||||
io.stderr:write(reason .. "\n")
|
||||
else
|
||||
file:write(args[1])
|
||||
file:close()
|
||||
os.setenv("HOSTNAME", args[1])
|
||||
os.setenv("PS1", "$HOSTNAME:$PWD# ")
|
||||
end
|
||||
else
|
||||
local file = io.open("/etc/hostname")
|
||||
if file then
|
||||
io.write(file:read("*l"), "\n")
|
||||
file:close()
|
||||
else
|
||||
io.stderr:write("Hostname not set\n")
|
||||
end
|
||||
end
|
@ -13,4 +13,13 @@ shell.setAlias("rs", "redstone")
|
||||
shell.setAlias("view", "edit -r")
|
||||
shell.setAlias("help", "man")
|
||||
shell.setAlias("?", "man")
|
||||
shell.setAlias("cp", "cp -i")
|
||||
shell.setAlias("cp", "cp -i")
|
||||
|
||||
event.listen("init", function()
|
||||
local file = io.open("/etc/hostname")
|
||||
if file then
|
||||
os.setenv("HOSTNAME", file:read("*l"))
|
||||
os.setenv("PS1", "$HOSTNAME:$PWD# ")
|
||||
file:close()
|
||||
end
|
||||
end)
|
||||
|
@ -0,0 +1,12 @@
|
||||
NAME
|
||||
hostname - Display and modify hostname
|
||||
|
||||
SYNOPIS
|
||||
hostname [NEW NAME]
|
||||
|
||||
EXAMPLES
|
||||
hostname
|
||||
Prints currently set hostname
|
||||
|
||||
hostname test
|
||||
Sets hostname of this computer to test
|
@ -51,6 +51,7 @@ Kilobyte # Contributor
|
||||
KITT # Knight Rider
|
||||
Kodos # Contributor
|
||||
Laire # Perry Rhodan
|
||||
Loader 1340 # Borderlands 2
|
||||
LordFokas # Contributor
|
||||
Marvin # Hitchhiker's Guide to the Galaxy
|
||||
Michiyo # Contributor
|
||||
|
Loading…
x
Reference in New Issue
Block a user