mirror of
https://git.ari.lt/ari.lt/ari.lt.git
synced 2025-02-04 17:49:24 +01:00
update @ Sat 9 Oct 04:12:07 EEST 2021
This commit is contained in:
parent
068ed5acd3
commit
e6dc1c4fc5
2 changed files with 2 additions and 11 deletions
|
@ -117,7 +117,7 @@ function su(cmd) {
|
|||
if (cmd[0]) {
|
||||
if (cmd[0] == '.') {
|
||||
root = !root
|
||||
return `Switched to the <b>${root ? '<b>root</b>' : localStorage.getItem('username')}</b> user.`
|
||||
return `Switched to the <b>${root ? 'root' : localStorage.getItem('username')}</b> user.`
|
||||
} else {
|
||||
root = true;
|
||||
let ret = 'Command not found';
|
||||
|
|
|
@ -4,15 +4,6 @@ let cmd_history = document.getElementById('cmd_hist');
|
|||
let shell = document.getElementById('shell');
|
||||
var is_root = false;
|
||||
|
||||
const html_bad_tags = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>'
|
||||
};
|
||||
|
||||
function replaceTag(tag) {
|
||||
return html_bad_tags[tag] || tag;
|
||||
}
|
||||
|
||||
function main() {
|
||||
cmd_prompt.onkeypress = (e) => {
|
||||
|
@ -27,7 +18,7 @@ function main() {
|
|||
|
||||
if (commands[command]) {
|
||||
if (commands[command]['root_only'] && !root) {
|
||||
cmd_output.innerHTML = `'${command.replace(/[&<>]/g, replaceTag)}' can <i>only</i> be ran as <b>root</b>. see <b>help su</b>`
|
||||
cmd_output.innerHTML = `'${command}' can <i>only</i> be ran as <b>root</b>. see <b>help su</b>`
|
||||
} else {
|
||||
cmd_output.innerHTML = commands[command]['func'](argv);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue