Circlean/fs_filecheck/opt/groomer/init.sh

26 lines
474 B
Bash
Raw Normal View History

2015-11-06 17:40:33 +01:00
#!/bin/bash
2017-01-12 21:42:41 +01:00
# set -e (exit when a line returns non-0 status) and -x (xtrace) flags
2015-11-06 17:40:33 +01:00
set -e
set -x
# Import constants from config file
2017-01-12 21:42:41 +01:00
source ./config.sh
2015-11-06 17:40:33 +01:00
if [ ${ID} -ne 0 ]; then
echo "GROOMER: This script has to be run as root."
2015-11-06 17:40:33 +01:00
exit
fi
clean(){
echo "GROOMER: cleaning up after init.sh."
2015-11-06 17:40:33 +01:00
${SYNC}
}
trap clean EXIT TERM INT
# List block storage devices (for debugging)
lsblk |& tee ${GROOM_LOG}
2017-01-12 20:00:51 +01:00
su ${USERNAME} -c ./mount_dest.sh |& tee -a ${GROOM_LOG}