Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
删除无效的效果图节点
#!/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