Fix returning stor directory from database in uninstall, work on getting lxc-bootstrap working with debian
This commit is contained in:
parent
3908e82667
commit
9f6bd33076
|
@ -35,11 +35,11 @@ lxc-start -n ${name} -d
|
|||
echo "...Done"
|
||||
|
||||
echo -e "\n * Running apt update..."
|
||||
lxc-attach -n ${name} -e -- apt-get update
|
||||
lxc-attach -n ${name} -- apt-get update
|
||||
echo "...Done"
|
||||
|
||||
echo -e "\n * Installing git..."
|
||||
lxc-attach -n ${name} -e -- apt-get -y --force-yes install git
|
||||
lxc-attach -n ${name} -- apt-get -y --force-yes install git
|
||||
echo "...Done"
|
||||
|
||||
echo -e "\n * Cloning Airtime..."
|
||||
|
|
10
uninstall
10
uninstall
|
@ -9,12 +9,12 @@ fi
|
|||
|
||||
getStorDirFromDatabase() {
|
||||
# here-doc to execute this block as postgres user
|
||||
su postgres <<'EOF'
|
||||
result=`su postgres <<'EOF'
|
||||
set +e
|
||||
result=$(psql -d airtime -tAc "SELECT directory FROM cc_music_dirs WHERE type='stor'")
|
||||
echo $(psql -d airtime -tAc "SELECT directory FROM cc_music_dirs WHERE type='stor'")
|
||||
set -e
|
||||
# don't indent this!
|
||||
EOF
|
||||
EOF`
|
||||
echo $result
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,9 @@ dropAirtimeDatabase() {
|
|||
# here-doc to execute this block as postgres user
|
||||
su postgres <<'EOF'
|
||||
set +e
|
||||
psql -d postgres -tAc "DROP DATABASE IF EXISTS airtime; DROP USER IF EXISTS airtime;"
|
||||
# DROP DATABASE cannot be executed from a function or multi-command string
|
||||
psql -d postgres -tAc "DROP DATABASE IF EXISTS airtime"
|
||||
psql -d postgres -tAc "DROP USER IF EXISTS airtime"
|
||||
set -e
|
||||
# don't indent this!
|
||||
EOF
|
||||
|
|
Loading…
Reference in New Issue