SA-SOSDG/build.sh

39 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
VERSION=36
TAR=`which tar`
MYSQL=`which mysql`
EPOCH=`date +%s`
TARBALL="${VERSION}.tar.gz"
SHA1SUM=`which sha1sum`
DNSUSER="brielle"
DNSDOMAIN="*.3.sa.sosdg.org"
DNSDB="ns1-powerdns"
DNSTABLE="records"
${TAR} zvcf ../../${TARBALL} --exclude-vcs --exclude='*.sh' * ;\
cd ../../
${SHA1SUM} ${TARBALL} > ${TARBALL}.sha1
#echo -n "Mysql password: "
#stty -echo
#read password
#stty echo
#DNSSOA=`echo "SELECT content FROM ${DNSTABLE} WHERE domain_id='4'
# AND name='sosdg.org' AND type='SOA'" |\
# ${MYSQL} --user=${DNSUSER} --password=$password ${DNSDB}`
#DNSSOA2=( ${DNSSOA// / } )
#NEW_SOA="${DNSSOA2[1]} ${DNSSOA2[2]} $((${DNSSOA2[3]}+1)) ${DNSSOA2[4]} ${DNSSOA2[5]} ${DNSSOA2[6]} ${DNSSOA2[7]}"
#echo "UPDATE ${DNSTABLE} SET content='${VERSION}', change_date='${EPOCH}'
# WHERE name='${DNSDOMAIN}' AND type='TXT'" |\
# ${MYSQL} --user=${DNSUSER} --password=$password ${DNSDB}
#
#echo "UPDATE ${DNSTABLE} SET content='${NEW_SOA}', change_date='${EPOCH}'
# WHERE domain_id='4' AND name='sosdg.org' AND type='SOA'" |\
# ${MYSQL} --user=${DNSUSER} --password=$password ${DNSDB}
#unset password