Skip to content

Commit 536df45

Browse files
author
Hubert
authored
Created in v1.10
1 parent 213ac9b commit 536df45

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
. .server-settings
4+
5+
# mcCOMMAND should now be translated to COMMAND
6+
# and COMMAND_PARAM should now be translated to COMMAND PARAM
7+
COMMAND=`basename $0 | sed -e "s/^mc//" -e "s/_/ /g"`
8+
9+
MARKER=`date "+%s"`
10+
screen -S ${GNUSCREEN_SESSION} -p ${GNUSCREEN_WINDOW} -X stuff "msg NonExistent ${MARKER}-begin Executing command ${COMMAND}"`printf \\\r`
11+
screen -S ${GNUSCREEN_SESSION} -p ${GNUSCREEN_WINDOW} -X stuff "${COMMAND} ${*}"`printf \\\r`
12+
screen -S ${GNUSCREEN_SESSION} -p ${GNUSCREEN_WINDOW} -X stuff "msg NonExistent ${MARKER}-end Executing command ${COMMAND}"`printf \\\r`
13+
sleep 1
14+
awk "/$MARKER-begin Executing command ${COMMAND}/, /$MARKER-end Executing command ${COMMAND}/" ${SERVER_ROOT}/logs/latest.log \
15+
| grep -v "Executing command ${COMMAND}" \
16+
| tail +3
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
. .server-settings
4+
5+
# mcCOMMAND should now be translated to COMMAND
6+
# and COMMAND_PARAM should now be translated to COMMAND PARAM
7+
COMMAND=`basename $0 | sed -e "s/^mc//" -e "s/_/ /g"`
8+
9+
screen -S ${GNUSCREEN_SESSION} -p ${GNUSCREEN_WINDOW} -X stuff "${COMMAND} ${*}"`printf \\\r`

Commands/setuid/PassThrough

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
. .server-settings
4+
5+
MARKER=`date "+%s"`
6+
screen -S ${GNUSCREEN_SESSION} -p ${GNUSCREEN_WINDOW} -X stuff "msg NonExistent ${MARKER}-begin Executing passthrough command"`printf \\\r`
7+
screen -S ${GNUSCREEN_SESSION} -p ${GNUSCREEN_WINDOW} -X stuff "${*}"`printf \\\r`
8+
screen -S ${GNUSCREEN_SESSION} -p ${GNUSCREEN_WINDOW} -X stuff "msg NonExistent ${MARKER}-end Executing passthrough command"`printf \\\r`
9+
sleep 1
10+
awk "/$MARKER-begin Executing passthrough command/, /$MARKER-end Executing passthrough command/" ${SERVER_ROOT}/logs/latest.log \
11+
| grep -v "Executing passthrough command" \
12+
| tail +3

0 commit comments

Comments
 (0)