Skip to content

Instantly share code, notes, and snippets.

@xx7y7xx
Last active February 24, 2016 09:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xx7y7xx/ce339cb02d2645bc9102 to your computer and use it in GitHub Desktop.
Save xx7y7xx/ce339cb02d2645bc9102 to your computer and use it in GitHub Desktop.
删除无效的效果图节点
#!/bin/bash
# Usage:
# Save xiaoguotu table to /tmp/joblist.txt
# remove_preview_node.sh pansuo
# Download this script: https://gist.github.com/xxd3vin/ce339cb02d2645bc9102
joblist=/tmp/joblist.txt
tmpfile=${joblist}.tmp
if [ -z $1 ]; then
echo "pls input user name"
exit 1
fi
name=$1
awk '{ print $6 }' $joblist > $tmpfile
while read jobid; do
if [[ $jobid != job* ]]; then
echo "bad jobid: $jobid"
continue
fi
cmd="curl -s -I -u admin:admin -X DELETE \"192.168.0.66:9999/content/users/_${name}_40spolo.org/previewlib/$jobid\""
echo $cmd
$cmd | head -n 1
#ret=$?
#if [ $? -ne 0 ]; then
# echo "$jobid $ret"
#fi
done < $tmpfile
rm -rf $tmpfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment