fixed reactivate_regexes.sh for all users

This commit is contained in:
jonnyboy
2013-03-31 11:29:19 -04:00
parent 13d2674c9c
commit 9443ce509d
2 changed files with 17 additions and 6 deletions
+16 -5
View File
@@ -1,11 +1,22 @@
#!/usr/bin/env bash
SOURCE="${BASH_SOURCE[0]}"
DIR="$( dirname "$SOURCE" )"
while [ -h "$SOURCE" ]
do
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
cd $DIR"/../conf"
source $DIR"/../defaults.sh"
eval $( $SED -n "/^define/ { s/.*('\([^']*\)', '*\([^']*\)'*);/export \1=\"\2\"/; p }" "$NEWZPATH"/www/config.php )
cd $DIR"/conf"
for fn in `cat active_regexes.txt`; do
echo "Resetting $fn"
mysql --defaults-file=my.cnf -uroot newznab -e "update releaseregex set status=1 where ID=$fn"
echo "Resetting regex $fn"
mysql --defaults-file=my.cnf -u$DB_USER -h $DB_HOST $DB_NAME -e "update releaseregex set status=1 where ID=$fn"
done
#rm active_regexes.txt
rm active_regexes.txt