diff options
Diffstat (limited to 'packaging/SGI/startswat.sh')
-rwxr-xr-x | packaging/SGI/startswat.sh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/packaging/SGI/startswat.sh b/packaging/SGI/startswat.sh index c2fc9fb467..2a0333020f 100755 --- a/packaging/SGI/startswat.sh +++ b/packaging/SGI/startswat.sh @@ -2,8 +2,12 @@ # # add SWAT deamon to inetd.conf # -cp /etc/inetd.conf /etc/inetd.O -sed -e "/^swat/D" -e "/^#SWAT/D" /etc/inetd.O > /etc/inetd.conf +cp /etc/inetd.conf /etc/inetd.conf.O + +if [ $? -ne 0 ]; then exit 1; fi +if [ ! -r /etc/inetd.conf.O -o ! -w /etc/inetd.conf ]; then exit 1; fi + +sed -e "/^swat/D" -e "/^#SWAT/D" /etc/inetd.conf.O > /etc/inetd.conf echo '#SWAT services' >> /etc/inetd.conf echo swat stream tcp nowait root /usr/samba/bin/swat swat >> /etc/inetd.conf @@ -11,6 +15,10 @@ echo swat stream tcp nowait root /usr/samba/bin/swat swat >> /etc/inetd.con # add SWAT service port to /etc/services # cp /etc/services /etc/services.O + +if [ $? -ne 0 ]; then exit 1; fi +if [ ! -r /etc/services.O -o ! -w /etc/services ]; then exit 1; fi + sed -e "/^swat/D" -e "/^#SWAT/D" /etc/services.O > /etc/services echo '#SWAT services' >> /etc/services echo 'swat 901/tcp # SWAT' >> /etc/services |