2016-08-03 21:37:16 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -xe
|
|
|
|
|
2017-02-16 17:01:50 +00:00
|
|
|
pid="$1"
|
2016-08-03 21:37:16 +00:00
|
|
|
|
2017-02-16 17:01:50 +00:00
|
|
|
if [[ -z "$pid" ]]; then
|
|
|
|
echo "usage: $0 pid"
|
2016-08-03 21:37:16 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# delete any existing temporary iscsi.conf files
|
2018-02-06 06:41:38 +00:00
|
|
|
rm -f /tmp/iscsi.conf*
|
2016-08-03 21:37:16 +00:00
|
|
|
|
2017-02-16 17:01:50 +00:00
|
|
|
kill -USR1 "$pid"
|
2016-08-03 21:37:16 +00:00
|
|
|
|
|
|
|
if [ ! -f `ls /tmp/iscsi.conf.*` ]; then
|
2017-02-16 17:01:50 +00:00
|
|
|
echo "iscsi_tgt did not generate config file"
|
2016-08-03 21:37:16 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
mv `ls /tmp/iscsi.conf.*` /tmp/iscsi.conf
|