A launch script

Guides, tutorials, tips & tricks.
Post Reply
LuckyEddie
Posts: 52
Joined: Wed Apr 14, 2021 12:31 pm

A launch script

Post by LuckyEddie »

I've just reloaded my laptop with Fedora and re-installed StarTools. As I'm putting in the effort to address old issues with my setup I thought it was time to add a small feature that I've wanted for a long time. The following script is called from a menu application launcher. It stores the start time/date, launches StarTools, and when it closes renames the StarTools.log with the start time/date in the filename. This simplifies the use of STReplay.

Code: Select all

#!/bin/bash

# Record the current timestamp
launchtime=$(date +"%Y-%m-%d %H:%M:%S")
# Debug only echo "$launchtime"

# Launch StarTools in the current directory
./StarTools-Linux64-GPU

# Rename the log
if [ -f ./StarTools.log ]; then
  mv ./StarTools.log "StarTools $launchtime.log"
fi
This is a Linux only implementation but it should be easy to adapt for other systems if someone chooses to do so. Hope it helps someone.
Post Reply