Sovran_SystemsOS/file_fixes_and_new_services/test.sh

62 lines
1.1 KiB
Bash
Raw Normal View History

2023-06-21 14:19:13 -07:00
#!/usr/bin/env bash
2023-06-22 15:11:28 -07:00
function log_console () {
echo "`date` :: $1" >> /var/lib/beacons/awesome.log
echo $1
}
2023-06-21 14:19:13 -07:00
#### CHECK TO SEE IF IT HAS BEEN RUN BEFORE ####
2023-06-22 18:16:54 -07:00
FILE=/var/lib/beacons/file_fixes_and_new_services/jitsi/completed
2023-06-21 14:19:13 -07:00
if [ -e $FILE ]; then
2023-06-21 21:16:33 -07:00
/run/current-system/sw/bin/echo "File Found :), No Need to Run ... Exiting"
2023-06-21 14:19:13 -07:00
exit 1
fi
#### CREATE INITIAL TAG ####
2023-06-21 20:15:00 -07:00
/run/current-system/sw/bin/mkdir -p /var/lib/beacons/file_fixes_and_new_services/jitsi ; touch /var/lib/beacons/file_fixes_and_new_services/jitsi/started
2023-06-21 14:19:13 -07:00
if [[ $? != 0 ]]; then
2023-06-21 20:15:00 -07:00
/run/current-system/sw/bin/echo "Could Not Create Initial Tag"
2023-06-21 14:19:13 -07:00
exit 1
fi
#### MAIN SCRIPT ####
2023-06-21 20:15:00 -07:00
/run/current-system/sw/bin/mkdir /var/lib/cool
2023-06-21 14:19:13 -07:00
if [[ $? != 0 ]]; then
2023-06-21 20:15:00 -07:00
/run/current-system/sw/bin/echo "Could Not Create Cool"
2023-06-21 14:19:13 -07:00
exit 1
fi
#### CREATE COMPELETE TAG ####
2023-06-21 20:15:00 -07:00
/run/current-system/sw/bin/touch /var/lib/beacons/file_fixes_and_new_services/jitsi/completed
2023-06-21 14:19:13 -07:00
if [[ $? != 0 ]]; then
2023-06-21 20:15:00 -07:00
/run/current-system/sw/bin/echo "Could Not Create Completed Tag"
2023-06-21 14:19:13 -07:00
exit 1
fi
exit 0