| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622 |
- #!/bin/bash
- #
- # Copyright (c) 2019 Clementine Computing LLC.
- #
- # This file is part of PopuFare.
- #
- # PopuFare is free software: you can redistribute it and/or modify
- # it under the terms of the GNU Affero General Public License as published by
- # the Free Software Foundation, either version 3 of the License, or
- # (at your option) any later version.
- #
- # PopuFare is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU Affero General Public License for more details.
- #
- # You should have received a copy of the GNU Affero General Public License
- # along with PopuFare. If not, see <https://www.gnu.org/licenses/>.
- #
- GITURL="https://tree.clementinecomputing.com/clementinecomputing/popufare"
- echo ""
- echo ' _____ __ '
- echo ' | __ \ / _| '
- echo ' | |__) |__ _ __ _ _| |_ __ _ _ __ ___ '
- echo ' | ___/ _ \| '"'"'_ \| | | | _/ _` | '"'"'__/ _ \'
- echo ' | | | (_) | |_) | |_| | || (_| | | | __/'
- echo ' |_| \___/| .__/ \__,_|_| \__,_|_| \___|'
- echo ' | | '
- echo ' |_| '
- echo ""
- echo "This script attempts to setup a default installation of Popufare on a busunit (a Raspberry Pi, say)"
- echo "by setting up and configuring the system."
- echo ""
- echo "THIS SCRIPT CHANGES SYSTEM WIDE PARAMETERS AND COULD HAVE SERIOUS CONSEQUENCES TO THE MACHINE IT'S RUN"
- echo "ON."
- echo ""
- echo "As such, this scripts needs root access (via sudo)."
- echo "This script is meant to be a 'helper' script and isn't meant to be all encompassing. Among other things,"
- echo "this script will:"
- echo ""
- echo " * setup a 'bus' user and group"
- echo " * add the 'pi' user to the 'bus' group"
- echo " * clone the Popufare repo, build it's binaries and install them in the '/home/bus' user directory"
- echo " * copy over appropriate config files to the appropriate locations in the '/hom/ebus' user directory"
- echo " * setup ssh keys and credentials"
- echo " * setup the PPP config files"
- echo " * alter /boot/config.txt and /etc/modules to enable serial and sound setup"
- echo " * setup a 'kiosk' service for the front end DIU"
- echo " * setup 'rc.local' to start and monitor bus Popufare services on startup"
- echo " * setup legacy data directories in '/mnt/data2'"
- echo ""
- echo "Most parameters have options to prompt the user for installation."
- echo ""
- echo "This script should be used with caution and as a helper for an installation rather than a 'turn key' soluation."
- echo "For example, the ssh keys default to the UNSECURE 'snakeoil' default keys provided the repo for easy setup and"
- echo "MUST BE CHANGED for a production installation."
- echo ""
- echo "In addition, the host and other config file options should be set on a per installation basis, as should the custom"
- echo "DIU interface, rules, drivers.txt entries, etc."
- echo ""
- echo "This script should help in getting a Raspberry Pi ready for use with Popufare but should be thought of also as a"
- echo "record of what relevant files there are to change and where to look."
- echo ""
- echo "As Popufare matures, this installation script or something similar can accomodate a more seamless installation but"
- echo "this is what is provided now."
- echo ""
- echo "Popufare is free software so please feel free to contribute at:"
- echo ""
- echo " https://tree.clementinecomputing.com/clementinecomputing/popufare"
- echo ""
- echo -n "Hit return to continue [ok]: "
- read hitreturn
- DATESTR=`date '+%Y%m%d%H%M%S'`
- ###### basic sanity checks to make sure we're installing on a Raspberry Pi
- ######
- if [[ ! -e /etc/os-release ]] ; then
- echo -n "Are you sure you want to install? '/etc/os-release' does not exist and this system might not be a Raspberry Pi. Continue? [y/N]: "
- read fnfok
- if [[ ! "$fnfok" =~ ^[yY]$ ]] ; then
- echo "cancelling installalation"
- echo ""
- exit
- else
- echo "ok, continuing installation..."
- fi
- else
- grep -P '^PRETTY_NAME="Raspbian' /etc/os-release 2>&1 > /dev/null
- r=$?
- if [[ $r != 0 ]] ; then
- echo -n "Raspbian not detected in '/etc/os-release'. This might not be Raspberry Pi. Continue with installation? [y/N]: "
- read okcontinue
- if [[ ! "$okcontinue" =~ ^[yY]$ ]] ; then
- echo "cancelling installation"
- echo ""
- exit
- else
- echo "ok, continuing installation..."
- fi
- fi
- fi
- echo ""
- ######
- ######
- echo -n "Install package dependencies? [Y/n]: "
- read adddeps
- if [[ "$adddeps" =~ ^[yY]?$ ]]; then
- deps="espeak mplayer git ppp ppp-dev sox alsa-utils unclutter fbi xinput-calibrator ffmpeg jq matchbox-window-manager libi2c-dev "
- echo ""
- echo " Installing: $deps"
- sudo apt-get update
- sudo apt-get install -y $deps
- echo ""
- echo -n " Remove unused packages (free up space)? [Y/n]: "
- read remunused
- if [[ "$remunused" =~ ^[yY]?$ ]]; then
- remdeps="libreoffice libreoffice-base-core libreoffice-common \
- libreoffice-core libreoffice-help-common libreoffice-help-en-gb \
- libreoffice-help-en-us libreoffice-l10n-en-gb \
- libreoffice-style-colibre libreoffice-style-tango \
- wolfram-engine scratch scratch2"
- echo ""
- echo " Removing: $remdeps"
- #sudo apt-get remove -y $remdeps
- #sudo apt-get autoremove -y --purge
- apt-get purge -y $remdeps
- echo ""
- fi
- fi
- echo ""
- ######
- ######
- echo -n "Create 'bus' user? [Y/n]: "
- read createbususer
- if [[ "$createbususer" =~ ^[yY]?$ ]]; then
- echo "... creating 'bus' user and group"
- sudo adduser bus
- sudo usermod -a -G dialout bus
- fi
- echo ""
- echo -n "Add 'pi' to 'bus' group? [Y/n]: "
- read addpibus
- if [[ "$addpibus" =~ ^[yY]$ ]]; then
- echo "... add 'pi' to 'bus' group"
- sudo usermod -a -G bus pi
- fi
- echo ""
- echo "Creating /home/bus/(bin|database|config) with group write permissions"
- sudo mkdir -p /home/bus/bin
- sudo mkdir -p /home/bus/database
- sudo mkdir -p /home/bus/config
- sudo chown -R bus:bus /home/bus/bin
- sudo chown -R bus:bus /home/bus/database
- sudo chown -R bus:bus /home/bus/config
- sudo chmod -R g+w /home/bus/bin
- sudo chmod -R g+w /home/bus/database
- sudo chmod -R g+w /home/bus/config
- echo ""
- echo -n "Repo path (hit return to automatically clone the repo and use that) []: "
- read repolocation
- tmpdir=""
- if [[ "$repolocation" == "" ]] ; then
- tmpdir=`mktemp -d`
- repolocation="$tmpdir/popufare"
- pushd $tmpdir
- git clone "$GITURL"
- popd
- fi
- echo "Setting up binaries..."
- bd=/home/bus/popufare/busunit
- d=/home/bus/popufare/busunit/bin/native
- diudir=/home/bus/popufare/busunit/DIUv2
- tc=/home/bus/popufare/busunit/testing/config
- sudo cp -R $repolocation /home/bus
- sudo chown -R bus:bus /home/bus/popufare
- sudo bash -c " su - bus -c ' cd /home/bus/popufare/busunit ; ./build_all.sh native ; ' "
- sudo bash -c " cd /home/bus/bin ; cp -fRL $d/avls . ; cp -fRL $d/billdb . ; cp -fRL $d/client_supervisor . ; cp -fRL $d/debug_client . ; cp -fRL $d/diu_minder . ; cp -fRL $d/ipc_server . "
- sudo bash -c " cd /home/bus/bin ; cp -fRL $d/paddlemgr . ; cp -fRL $d/passdb . ; cp -fRL $d/piu_minder . ; cp -fRL $d/send_billing_record . ; cp -fRL $d/send_magstripe . "
- sudo bash -c " cd /home/bus/bin ; cp -fRL $d/gps_minder . "
- sudo bash -c " cd /home/bus/bin ; cp -fRL $bd/DIUv2/diu_kiosk . "
- sudo bash -c " cd /home/bus/bin ; cp -fRL $bd/scripts/init_bus.sh . ; cp -fRL $bd/scripts/update_loop.sh . ; cp -fRL $bd/scripts/setup-serial.py . ; cp -fRL $bd/scripts/get_net_ids.sh . "
- sudo bash -c " cd /home/bus/bin ; cp -fRL $bd/scripts/connection_tether.sh . ; cp -fRL $bd/scripts/reset-gps.py ./reset-gps "
- sudo bash -c " cd /home/bus/bin ; cp -fRL $bd/scripts/apply_update.sh . ; cp -fRL $bd/scripts/apply_update_legacy.sh . ; cp -fRL $bd/scripts/apply_update_popufare.sh . "
- sudo bash -c " cd /home/bus/bin ; cp -fRL $bd/scripts/fix_pkg_perm.sh . "
- sudo bash -c " cd /home/bus/bin ; cp -fRL $bd/scripts/unpack_server_data.sh . "
- sudo bash -c " cd /home/bus/bin ; cp -fRL $bd/scripts/say . "
- sudo bash -c " cd /home/bus/bin ; cp -fRL $bd/scripts/volumeset . "
- sudo bash -c " cd /home/bus/bin ; cp -fRL $bd/scripts/start-kiosk.sh . "
- sudo bash -c " cd /home/bus/config ; cp -fRL $diudir/html . ; "
- sudo bash -c " cd /home/bus/config ; cp $bd/passdb/init.scm . ; cp $bd/passdb/rfid_patterns.txt . ; cp $bd/avls/avls_freq.txt . "
- sudo bash -c " cd /home/bus/config ; cp $bd/passdb/init.scm . ; cp $bd/passdb/rfid_patterns.txt . ; cp $bd/avls/avls_freq.txt . "
- sudo bash -c " cd /home/bus/config ; cp $tc/equipnum.txt . ; cp $tc/serial.txt serial_num "
- sudo bash -c " rm -f /home/bus/bin/common_values.sh ; cp $bd/scripts/common_values.sh /home/bus/bin "
- ## server endpoint config files
- ##
- ## sync_server_desc, sync_target, server_list, syn_port
- sudo cp /home/bus/popufare/busunit/testing/config/config.tgz.checksum /home/bus/config/config.tgz.checksum
- sudo cp /home/bus/popufare/busunit/testing/config/config.tgz.version /home/bus/config/config.tgz.version
- sudo cp /home/bus/popufare/busunit/testing/config/firmware.tgz.checksum /home/bus/config/firmware.tgz.checksum
- sudo cp /home/bus/popufare/busunit/testing/config/firmware.tgz.version /home/bus/config/firmware.tgz.version
- sudo cp /home/bus/popufare/busunit/testing/config/package.tgz.checksum /home/bus/config/package.tgz.checksum
- sudo cp /home/bus/popufare/busunit/testing/config/package.tgz.version /home/bus/config/package.tgz.version
- sudo mkdir -p /home/bus/config/server
- echo ""
- ##### paddle setup
- #####
- echo -n "Setup paddles? [Y/n]: "
- read setuppaddles
- if [[ "$setuppaddles" =~ ^[yY]?$ ]] ; then
- echo -n "Paddle location? (blank for default testing paddles) []: "
- read paddlocation
- if [[ "$paddlelocation" == "" ]] ; then
- paddlelocation=$bd/busunit/testing
- fi
- echo "Using '$paddlelocation/*.paddle'..."
- sudo bash -c " cd /home/bus/config ; cp $bd/testing/*.paddle . "
- fi
- echo ""
- ##### rules setup
- #####
- echo -n "Setup rules? [Y/n]: "
- read setuprules
- if [[ "$setuprules" =~ ^[yY]?$ ]] ; then
- echo -n "Rule file? (blank for default testing rules) []: "
- read rulelocation
- if [[ "$rulelocation" == "" ]] ; then
- rulelocation=$bd/testing/rules-ORG.scm
- fi
- echo "Setting up rules from '$rulelocation'..."
- sudo bash -c " cd /home/bus/config ; cp $rulelocation rules.scm "
- fi
- echo ""
- ##### equipment number setup
- #####
- echo -n "Equipment number? [9999]: "
- read equipnum
- if [[ "$equipnum" == "" ]] ; then
- equipnum=9999
- fi
- echo "Setting equipment number to '$equipnum'..."
- sudo bash -c " echo $equipnum > /home/bus/config/equipnum.txt "
- echo ""
- ##### key setup
- #####
- echo -n "Setup secure communcation setup? [Y/n]: "
- read tunnelsetup
- if [[ "$tunnelsetup" =~ ^[yY]?$ ]] ; then
- echo -n " 'id_rsa' private key location? (default to snakeoil) []: "
- read keylocation
- if [[ "$keylocation" == "" ]] ; then
- keylocation=/home/bus/popufare/server/docker/snakeoil_id_rsa
- fi
- echo " Using '$keylocation' for private key..."
- sudo mkdir -p /home/bus/.ssh
- sudo chown -R bus:bus /home/bus/.ssh
- sudo cp $keylocation /home/bus/.ssh/id_rsa_bus
- sudo chown bus:bus /home/bus/.ssh/id_rsa_bus
- sudo chmod 400 /home/bus/.ssh/id_rsa_bus
- echo ""
- echo -n " Tunnel port? [6055]: "
- read tunnelport
- if [[ "$tunnelport" == "" ]] ; then
- tunnelport=6055
- fi
- echo ""
- echo -n " Tunnel user and host? [bus@example.com]: "
- read tunnelhost
- if [[ "$tunnelhost" == "" ]] ; then
- tunnelhost='bus@example.com'
- fi
- echo ""
- echo -n " Adding values to '/home/bus/bin/common_values.sh'..."
- sed -i 's;^SSH_DEFAULT_TARGET=;#SSH_DEFAULT_TARGET=;g' /home/bus/bin/common_values.sh
- sed -i 's;^SSH_DEFAULT_PORT=;#SSH_DEFAULT_PORT=;g' /home/bus/bin/common_values.sh
- sed -i 's;^SSH_DEFAULT_IDENTITY=;#SSH_DEFAULT_IDENTITY=;g' /home/bus/bin/common_values.sh
- sed -i 's;^SSH_TARGET=;#SSH_TARGET=;g' /home/bus/bin/common_values.sh
- sed -i 's;^SSH_PORT=;#SSH_PORT=;g' /home/bus/bin/common_values.sh
- sed -i 's;^SSH_IDENTITY=;#SSH_IDENTITY=;g' /home/bus/bin/common_values.sh
- echo 'SSH_DEFAULT_TARGET="'"$tunnelhost"'"' >> /home/bus/bin/common_values.sh
- echo 'SSH_DEFAULT_PORT="'"$tunnelport"'"' >> /home/bus/bin/common_values.sh
- echo 'SSH_DEFAULT_IDENTITY="/home/bus/.ssh/id_rsa_bus"' >> /home/bus/bin/common_values.sh
- echo '' >> /home/bus/bin/common_values.sh
- echo 'SSH_TARGET="$SSH_DEFAULT_TARGET"' >> /home/bus/bin/common_values.sh
- echo 'SSH_PORT="$SSH_DEFAULT_PORT"' >> /home/bus/bin/common_values.sh
- echo 'SSH_IDENTITY="$SSH_DEFAULT_IDENTITY"' >> /home/bus/bin/common_values.sh
- echo ""
- fi
- echo ""
- ##### drivers setup
- #####
- echo -n "'drivers.txt' location? (default to test) []: "
- read driverlocation
- if [[ "$driverlocation" == "" ]] ; then
- driverlocation=/home/bus/popufare/busunit/DIUv2/drivers.txt
- fi
- echo "Using '$driverlocation' for drivers.txt ..."
- sudo cp $driverlocation /home/bus/config
- echo ""
- ##### setup fona ppp
- #####
- echo -n "Setup FONA ppp files? [Y/n]: "
- read setupfona
- if [[ "$setupfona" =~ ^[yY]?$ ]] ; then
- echo " Creating /etc/ppp/peers/ and /etc/chatscripts/"
- sudo mkdir -p /etc/ppp/peers/
- sudo mkdir -p /etc/chatscripts/
- echo " /home/bus/popufare/busunit/ppp-dialer/etc/ppp/peers/fona -> /etc/ppp/peers/gprs"
- echo " /home/bus/popufare/busunit/ppp-dialer/etc/chatscripts/gprs -> /etc/chatscripts/gprs"
- sudo cp /home/bus/popufare/busunit/ppp-dialer/etc/ppp/peers/fona /etc/ppp/peers/gprs
- sudo cp /home/bus/popufare/busunit/ppp-dialer/etc/chatscripts/gprs /etc/chatscripts/gprs
- echo ""
- fi
- #echo -n "Setup FONA to connect at startup? [Y/n]: "
- #read fonanetwork
- #
- #if [[ "$fonanetwork" =~ ^[yY]?$ ]] ; then
- # echo " Creating '/etc/network/interfaces.d/fona'..."
- # sudo echo 'auto fona' > /etc/network/interfaces.d/fona
- # sudo echo 'iface fona inet ppp' >> /etc/network/interfaces.d/fona
- # sudo echo ' provider fona' >> /etc/network/interfaces.d/fona
- #fi
- ##### Setup config.txt
- #####
- echo -n "Setup '/boot/config.txt'? (Note this could have serious consequences, use with caution) [y/N]: "
- read setupconfig
- if [[ "$setupconfig" =~ ^[yY]$ ]] ; then
- tmpfn=`mktemp`
- bfn=`basename $tmpfn`
- echo " Saving 'config.txt' to /root/$bfn"
- sudo cp /boot/config.txt $tmpfn
- sudo mv $tmpfn /root/$bfn
- echo " adding> enable_uart=1"
- sudo sed -i 's;^enable_uart=;#enable_uart=;g' /boot/config.txt
- sudo bash -c 'echo "enable_uart=1" >> /boot/config.txt'
- echo " adding> dtoverlay=pi3-disable-bt"
- sudo sed -i 's;^dtoverlay=pi3-disable-bt;#dtoverlay=pi3-disable-bt;g' /boot/config.txt
- sudo bash -c 'echo "dtoverlay=pi3-disable-bt" >> /boot/config.txt'
- echo " adding> dtoverlay=pi3-disable-wifi"
- sudo sed -i 's;^dtoverlay=pi3-disable-wifi;#dtoverlay=pi3-disable-wifi;g' /boot/config.txt
- sudo bash -c 'echo "dtoverlay=pi3-disable-wifi" >> /boot/config.txt'
- fi
- echo ""
- ##### Setup sound in modules file
- #####
- echo -n "Setup sound (alter '/etc/modules')? [y/N]: "
- read setupsound
- if [[ "$setupsound" =~ ^[yY]$ ]] ; then
- tmpfn=`mktemp`
- bfn=`basename $tmpfn`
- echo " Saving 'modules' to /root/$bfn"
- sudo cp /etc/modules $tmpfn
- sudo mv $tmpfn /root/$bfn
- sudo sed -i 's;^snd-bcm2835;#snd-bcm2835;g' /etc/modules
- echo ' adding> snd-bcm2835'
- sudo bash -c 'echo "snd-bcm2835" >> /etc/modules'
- # disabled for now. Force audio to go through 3.5mm jack from 'raspi-config'.
- #
- # ...
- # trying to mitigate the 'first two seconds cutoff of audio' problem
- # https://github.com/alexa-pi/AlexaPi/wiki/Devices#raspberry-pi
- #
- #tfn=`mktemp`
- #echo '@reboot vcgencmd force_audio hdmi 1' > $tfn
- #echo "adding `cat $tfn`"
- #sudo crontab $tfn
- #rm $tfn
- fi
- ##### Change hostname
- #####
- echo -n "Change hostname? [y/N]: "
- read changehostname
- if [[ "$changehostname" =~ ^[yY]$ ]] ; then
- echo -n " New hostname [popufaredev]: "
- read newhostname
- if [[ "$newhostname" == "" ]] ; then
- newhostname=popufaredev
- fi
- echo " Saving /etc/hostname to /root/hostname.$DATESTR"
- sudo cp /etc/hostname /root/hostname.$DATESTR
- sudo bash -c "echo '$newhostname' > /etc/hostname"
- tfn=`mktemp`
- echo -e '127.0.0.1\tlocalhost' > $tfn
- echo -e '::1\t\tlocalhost ip6-localhost ip6-loopback' >> $tfn
- echo -e 'ff02::1\t\tip6-allnodes' >> $tfn
- echo -e 'ff02::2\t\tip6-allrouters' >> $tfn
- echo '' >> $tfn
- echo -e '127.0.1.1\t'"$newhostname" >> $tfn
- echo " Saving /etc/hosts to /root/hosts.$DATESTR"
- sudo cp /etc/hosts /root/hosts.$DATESTR
- echo " Creating new /etc/hosts file"
- sudo mv $tfn /etc/hosts
- sudo chmod 644 /etc/hosts
- fi
- ##### Setup kiosk
- #####
- echo -n "Setup kiosk service? [Y/n]: "
- read setupkiosk
- if [[ "$setupkiosk" =~ ^[yY]?$ ]] ; then
- echo " /home/bus/popufare/busunit/rootfs/etc/systemd/system/kiosk.service -> /lib/systemd/system/kiosk.service"
- sudo cp /home/bus/popufare/busunit/rootfs/etc/systemd/system/kiosk.service /lib/systemd/system/kiosk.service
- echo " enabling kiosk.service ('systemctl enable kiosk.service')"
- sudo systemctl enable kiosk.service
- ## Changing hostname will screw up chromium if it's already been run under a different
- ## hostname. Remove the files that cause the problems so Chromium can run without
- ## issue.
- ##
- echo " removing chromium 'Singleton*' files"
- sudo rm -rf /home/bus/.config/chromium/Singleton*
- fi
- echo ""
- ##### Setup startup
- #####
- echo -n "Setup startup 'rc.local'? [Y/n]: "
- read setupstartup
- if [[ "$setupstartup" =~ ^[yY]?$ ]] ; then
- tmpfn=`mktemp`
- bfn=`basename $tmpfn`
- echo " saving /etc/rc.local to /root/$bfn"
- sudo cp /etc/rc.local $tmpfn
- sudo mv $tmpfn /root/$bfn
- echo " /home/bus/popufare/busunit/rootfs/etc/rc.local -> /etc/rc.local"
- sudo cp /home/bus/popufare/busunit/rootfs/etc/rc.local /etc/rc.local
- fi
- echo ""
- ##### setup legacy data directories
- #####
- echo -n "Setup legacy data directories? [y/N]: "
- read setuplegacy
- if [[ "$setuplegacy" =~ ^[yY]$ ]] ; then
- sudo mkdir -p /mnt/data
- sudo mkdir -p /mnt/data2
- sudo chown -R bus:bus /mnt/data
- sudo chown -R bus:bus /mnt/data2
- fi
- #####
- #####
- ##### final permissions setup
- #####
- echo "Setting up final permission for /home/bus/(bin|database|config)"
- sudo chown -R bus:bus /home/bus/bin
- sudo chown -R bus:bus /home/bus/database
- sudo chown -R bus:bus /home/bus/config
- echo ""
- if [[ "$tmpdir" != '' ]] ; then
- echo "... should remove $tmpdir"
- #rm -rf $tmdpri
- fi
- echo "done"
|