Skip to content

Instantly share code, notes, and snippets.

@informationsea
Created March 11, 2014 03:44
Show Gist options
  • Save informationsea/9479125 to your computer and use it in GitHub Desktop.
Save informationsea/9479125 to your computer and use it in GitHub Desktop.
#!/bin/sh
function run() {
$@
if test $? -ne 0; then
echo "Failed $@"
exit 1
fi
}
function header() {
echo "========================================"
echo $1
echo "========================================"
}
function header2() {
echo "===== $1 ====="
}
header "Complex Configuration"
run qconf -sc
header "Host configuration"
HOSTS=`run qconf -sconfl`
echo $HOSTS
header2 "global"
run qconf -sconf global
N=0
for i in $HOSTS; do
header2 $i
run qconf -sconf $i
N=`expr $N + 1`
if [ $N -ge 10 ]; then
break
fi
sleep 0.2
done
header "Execution Hosts"
HOSTS=`run qconf -sel`
echo $HOSTS
N=0
for i in $HOSTS; do
header2 $i
run qconf -se $i
N=`expr $N + 1`
if [ $N -ge 10 ]; then
break
fi
sleep 0.2
done
header "Administration Hosts"
run qconf -sh
header "Quota"
QUOTA=`run qconf -srqsl`
echo $QUOTA
for i in $QUOTA; do
header2 $i
run qconf -srqs $i
done
header "Parallel Environment"
PE=`run qconf -spl`
echo $PE
for i in $PE; do
header2 $i
qconf -sp $i
sleep 0.2
done
header "Queue"
Q=`run qconf -sql`
echo $Q
for i in $Q; do
header2 $i
qconf -sq $i
sleep 0.2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment