forked from alanbjohnston/CubeSatSim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlog
More file actions
executable file
·17 lines (15 loc) · 664 Bytes
/
log
File metadata and controls
executable file
·17 lines (15 loc) · 664 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
echo -e "\nLog file script for CubeSatSim\n"
if [ "$1" = "-r" ] || [ "$1" = "-t" ] ; then
sudo journalctl -a -u transmit > /home/pi/CubeSatSim/logt.txt
cat /home/pi/CubeSatSim/logt.txt
echo -e "\nTransmit Log file also saved as /home/pi/CubeSatSim/logt.txt"
elif [ "$1" = "-c" ]; then
sudo journalctl -a -u command > /home/pi/CubeSatSim/logc.txt
cat /home/pi/CubeSatSim/logc.txt
echo -e "\nCommand and Control Log file also saved as /home/pi/CubeSatSim/logc.txt"
else
sudo journalctl -a -u cubesatsim > /home/pi/CubeSatSim/log.txt
cat /home/pi/CubeSatSim/log.txt
echo -e "\nLog file also saved as /home/pi/CubeSatSim/log.txt"
fi