diff --git a/postinstall_partage.sh b/postinstall_partage.sh index ba2e767fcea7f314310b4c068b6b5090366d3150..b95ed740757eea1417ebff3485ae9b70b64d01a1 100755 --- a/postinstall_partage.sh +++ b/postinstall_partage.sh @@ -16,23 +16,28 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -DIR=$(dirname $0) +DIR=$(realpath $(dirname $0)) cd /opt -apt-eole update -apt-eole install \ - git \ - printer-driver-splix \ - hplip \ - wakeonlan +if [ "$(dpkg -l | grep git)" ] +then + apt-eole update + apt-eole install \ + git \ + printer-driver-splix \ + hplip \ + wakeonlan +fi if [ ! -e "eole-wol" ] then git clone https://gitecoles.grenoble.fr/grenoble/eole-wol cd eole-wol else cd eole-wol - git pull + git stash + git checkout master + git pull origin master fi cp $DIR/*/service/*.service /etc/systemd/system/ @@ -52,7 +57,7 @@ done # Add registry clean to cronab line="0 1 1 * * $DIR/registry/scripts/clean.sh > /dev/null 2>&1" -(crontab -l; echo "${line}") | crontab - +(crontab -l | grep -v "registry"; echo "${line}") | crontab - # Copy ssh key to tftp while [ ! -e "/root/.ssh/id_rsa.pub" ] diff --git a/postinstall_reseau.sh b/postinstall_reseau.sh index 7111c74279b7c6b5b778b11f627fffab732f75d7..d8c6d887a3045eb9de26479d7311319f0c9c7aa3 100755 --- a/postinstall_reseau.sh +++ b/postinstall_reseau.sh @@ -20,16 +20,21 @@ DIR=$(dirname $0) cd /var/www -apt-eole update -apt-eole install \ - git \ - xrdp +if [ "$(dpkg -l | grep git)" ] +then + apt-eole update + apt-eole install \ + git \ + xrdp +fi if [ ! -e "eole-wol" ] then git clone https://gitecoles.grenoble.fr/grenoble/eole-wol else cd eole-wol - git pull + git stash + git checkout master + git pull origin master cd - fi diff --git a/upgrade_all.sh b/upgrade_all.sh new file mode 100755 index 0000000000000000000000000000000000000000..45276829e29714036d124cc6bca70fe9332c4bfa --- /dev/null +++ b/upgrade_all.sh @@ -0,0 +1,3 @@ +#!/bin/bash +git pull +`dirname $0`/do_postinstall.sh