ad 2:
#!/bin/bash
grep 127.0.0.1 /etc/hosts
if [ $? -eq 0 ]
then
echo "Nasel"
else
echo "Nenasel, nebo syntax terror"
fi
Mně tohle funguje jak víno (otestováno jak s 127.0.0.1, tak .0.2 - tedy obě varianty našel/nenašel). Co to máš za systém?edit:
ad 1:
to je nějaký orákl? Pak by mělo pro akceptaci nových nastavení postačovat restart dané služby nebo služeb.