Commit 8ccea1de authored by Vinicius Ruoso's avatar Vinicius Ruoso

Fix prd_refute script

When detecting if the school will be refuted or not it's necessary
to check the /etc/prd_version file. If the version is the 1.1 or some
2.0rc, the school must be refuted.

The problem happens when the school should not be refuted, but the
return statement wasn't work like expected, and the script keep
runnning, bloking the school.

Removing the return command and adding a block based "if" command
has solved this issue.
Signed-off-by: 's avatarVinicius Ruoso <vkr07@c3sl.ufpr.br>
parent 632b16c4
#!/bin/bash
( grep -q "1\.1" /etc/prd_version || grep -q "2\.0rc" /etc/prd_version ) ||
return 0
cat > /etc/nologin <<EOF
if grep -q "1\.1" /etc/prd_version || grep -q "2\.0rc" /etc/prd_version; then
cat > /etc/nologin <<EOF
Essa escola foi instalada com uma versão muito antiga do Paraná Digital
Por esse motivo, o acesso a usuários nessa escola está sendo desabilitado
......@@ -12,11 +10,12 @@ Por favor, entre em contato com o NRE para saber procedimentos.
Equipe de desenvolvimento do PrD
EOF
cp /etc/nologin /etc/refuta-prd1.1-nologin
cp /etc/nologin /etc/refuta-prd1.1-nologin
cat > /etc/rc2.d/S01refuta-prd1.1 <<EOF
cat > /etc/rc2.d/S01refuta-prd1.1 <<EOF
#!/bin/bash
cp /etc/refuta-prd1.1-nologin /etc/nologin
EOF
chmod a+x /etc/rc2.d/S01refuta-prd1.1
chmod a+x /etc/rc2.d/S01refuta-prd1.1
fi
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