Commit b9c982b1 authored by Vitaly Lipatov's avatar Vitaly Lipatov

update scripts

parent 280a6213
#!/bin/sh
for i in /azbyka/* ; do
skip='1'
for j in $i/www/*/wp-config.php $i/www/*/*/wp-config.php ; do
[ -f $j ] && skip='' && break
done
[ -n "$skip" ] && continue
echo "Copy to $i ..."
grep bg-azbyka@ $i/.ssh/authorized_keys && echo "skipped" && continue
cat >> $i/.ssh/authorized_keys <<EOF
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAgqJ8ZjWO4VkHnoP6QoOE1HFRwM4CC4akZlnoD6PzOihIS+68OQcVmxOZHWOhbwLjDoIkw+f+PVMt9ThsQFjU9a6hiVBZOWU2tl8aHe4qG/Kp5gR5KGk0+900MNkeJpIVQlhlIuSND8Se1PwG/GW0Wso+aiTt+35qFPEZcXYlcXExiWDouNBaGEr+yWiFzu3064GhgeKhsOW7+79RK1xTiO1x6Q9+VNHpIPRIqbNwbW7R3vjU4ofRc3VCvGP3jT9o6nMIn1Ztagt/vURWue56ejWd3z8jYnSMZM8/r2C8B/bvJCK4GDum0CMmoyiw8gFYtajkfbe5izqvZxsvX7r9CQ== bg-azbyka@
EOF
done
...@@ -35,7 +35,7 @@ gen_static_fallback() ...@@ -35,7 +35,7 @@ gen_static_fallback()
echo "generate $otf" echo "generate $otf"
cat $TEMPL | sed -e "s|@fallback|@fallback-$f|g" >$otf cat $TEMPL | sed -e "s|@fallback|@fallback-$f|g" >$otf
# TODO: merge with rewrite_if_changed # TODO: merge with rewrite_if_changed
[ -r "$of" ] || { echo "there is no target $of file" ; return 1; } #[ -r "$of" ] || { echo "there is no target $of file" ; return 1; }
[ -s "$otf" ] || { echo "empty generated file $otf" ; return 1; } [ -s "$otf" ] || { echo "empty generated file $otf" ; return 1; }
rewrite_if_changed "$otf" "$of" rewrite_if_changed "$otf" "$of"
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment