progress
This commit is contained in:
parent
e7d7af1889
commit
066a9fbdf1
@ -1,25 +1,48 @@
|
||||
#!/bin/sh
|
||||
|
||||
usage() {
|
||||
echo "Usage: ${0} <local_root_dir>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
echo "Started ${*} ..."
|
||||
|
||||
Domain=cvtt.vpn
|
||||
# User=cvtt
|
||||
RootDir=${1}
|
||||
|
||||
RootDir=/tmp/cronjobs
|
||||
if [ ! -d "${RootDir}" ]; then
|
||||
usage
|
||||
fi
|
||||
cd ${RootDir}
|
||||
|
||||
for User in cvtt oleg
|
||||
do
|
||||
echo "User=$User"
|
||||
hosts=$(curl -s http://cloud23.cvtt.vpn:6789/admin/cvtt_hosts | jq -r --arg domain "${Domain}" --arg usr ${User} '.[$domain] | to_entries[] | select(.value.users[] | contains($usr)) | .key')
|
||||
|
||||
# hosts=$(curl -s http://cloud23.cvtt.vpn:6789/admin/cvtt_hosts | jq -r --arg domain "${Domain}" --arg usr ${User} '.[$domain] | to_entries[] | select(.value.users[] | contains($usr)) | .key')
|
||||
hosts=$(
|
||||
curl -s http://cloud23.cvtt.vpn:6789/admin/cvtt_hosts | jq -r \
|
||||
--arg domain "${Domain}" \
|
||||
--arg usr "${User}" \
|
||||
'.[$domain] | to_entries[] | select(.value.users[] | contains($usr)) | .key'
|
||||
)
|
||||
mkdir -p ${RootDir}/${User}
|
||||
for host in ${hosts}
|
||||
do
|
||||
echo "===================="
|
||||
echo "${host}"
|
||||
echo "===================="
|
||||
ssh ${User}@${host}.${Domain} 'crontab -l' | tee ${RootDir}/${User}/${host}.cron
|
||||
done
|
||||
done
|
||||
|
||||
cd ${RootDir}
|
||||
git commit -a -m $(date)
|
||||
git pushall
|
||||
|
||||
Cmd="git add ."
|
||||
echo ${Cmd} && eval ${Cmd}
|
||||
|
||||
Cmd="git commit -a -m '$(date)'"
|
||||
echo ${Cmd} && eval ${Cmd}
|
||||
|
||||
Cmd="git pushall"
|
||||
echo ${Cmd} && eval ${Cmd}
|
||||
|
||||
echo "${0} Done."
|
||||
|
||||
@ -1 +1 @@
|
||||
1.2.5
|
||||
1.2.6
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user