Skip to content

Commit

Permalink
runcommand - allow the runcommand log directory to be changed.
Browse files Browse the repository at this point in the history
If an entry log_dir is made in /opt/retropie/configs/all/runcommand.cfg it will be used by runcommand for saving runcommand.log/runcommand.info files instead of the default /dev/shm
  • Loading branch information
joolswills committed Jun 15, 2022
1 parent 57b212d commit bc71978
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scriptmodules/supplementary/runcommand/runcommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@

ROOTDIR="/opt/retropie"
CONFIGDIR="$ROOTDIR/configs"
LOG="/dev/shm/runcommand.log"

RUNCOMMAND_CONF="$CONFIGDIR/all/runcommand.cfg"
VIDEO_CONF="$CONFIGDIR/all/videomodes.cfg"
Expand Down Expand Up @@ -119,6 +118,10 @@ function get_config() {
iniGet "image_delay"
IMAGE_DELAY="$ini_value"
[[ -z "$IMAGE_DELAY" ]] && IMAGE_DELAY=2
iniGet "log_dir"
LOGDIR="$ini_value"
[[ -z "$LOGDIR" ]] && LOGDIR="/dev/shm"
LOG="$LOGDIR/runcommand.log"
fi

if [[ -n "$DISPLAY" ]] && $XRANDR &>/dev/null; then
Expand Down Expand Up @@ -1308,7 +1311,7 @@ function launch_command() {
}
function log_info() {
echo -e "$SYSTEM\n$EMULATOR\n$ROM\n$COMMAND" >/dev/shm/runcommand.info
echo -e "$SYSTEM\n$EMULATOR\n$ROM\n$COMMAND" >"$LOGDIR/runcommand.info"
}
function runcommand() {
Expand Down

0 comments on commit bc71978

Please sign in to comment.