Changed user creating files.

pull/136/head
Joe Prochazka 2016-04-03 19:09:31 -04:00
rodzic deb662955a
commit f466df7263
1 zmienionych plików z 6 dodań i 4 usunięć

Wyświetl plik

@ -149,7 +149,7 @@ if [[ $ADVANCED =~ ^[yY]$ ]]; then
echo -e "Creating configuration file...\033[37m" echo -e "Creating configuration file...\033[37m"
case $DATABASEENGINE in case $DATABASEENGINE in
"2") "2")
sudo tee $BUILDDIR/portal/logging/config.json > /dev/null <<EOF tee $BUILDDIR/portal/logging/config.json > /dev/null <<EOF
{ {
"database":{"type":"sqlite", "database":{"type":"sqlite",
"host":"", "host":"",
@ -160,7 +160,7 @@ if [[ $ADVANCED =~ ^[yY]$ ]]; then
EOF EOF
;; ;;
*) *)
sudo tee $BUILDDIR/portal/logging/config.json > /dev/null <<EOF tee $BUILDDIR/portal/logging/config.json > /dev/null <<EOF
{ {
"database":{"type":"mysql", "database":{"type":"mysql",
"host":"localhost", "host":"localhost",
@ -172,9 +172,9 @@ EOF
;; ;;
esac esac
# Create flight logging maintainance script. # Create and set permissions on the flight logging maintainance script.
PYTHONPATH=`which python` PYTHONPATH=`which python`
sudo tee $BUILDDIR/portal/logging//flights-maint.sh > /dev/null <<EOF tee $BUILDDIR/portal/logging/flights-maint.sh > /dev/null <<EOF
#!/bin/sh #!/bin/sh
while true while true
do do
@ -182,6 +182,8 @@ while true
${PYTHONPATH} ${BUILDDIR}/portal/logging/flights.py ${PYTHONPATH} ${BUILDDIR}/portal/logging/flights.py
done done
EOF EOF
chmod +x $BUILDDIR/portal/logging/flights-maint.sh
# Add flight logging maintainance script to rc.local. # Add flight logging maintainance script to rc.local.
if ! grep -Fxq "${BUILDDIR}/portal/logging/flights-maint.sh &" /etc/rc.local; then if ! grep -Fxq "${BUILDDIR}/portal/logging/flights-maint.sh &" /etc/rc.local; then
echo -e "\033[33m" echo -e "\033[33m"