summaryrefslogtreecommitdiffstats
path: root/packaging/SGI/startswat.sh
diff options
context:
space:
mode:
authorDavid O'Neill <dmo@samba.org>2001-01-05 17:59:31 +0000
committerDavid O'Neill <dmo@samba.org>2001-01-05 17:59:31 +0000
commitc6f7358535eb96112e055d60d39c1595601d3056 (patch)
tree4c2c936347d91d241325fb234f33ddb3a4333950 /packaging/SGI/startswat.sh
parentafad150bacfd02ec83c57ea9ba9152ff59fb7eee (diff)
downloadsamba-c6f7358535eb96112e055d60d39c1595601d3056.tar.gz
samba-c6f7358535eb96112e055d60d39c1595601d3056.tar.xz
samba-c6f7358535eb96112e055d60d39c1595601d3056.zip
Sync up packaging updates that didn't make it to HEAD.
Diffstat (limited to 'packaging/SGI/startswat.sh')
-rwxr-xr-xpackaging/SGI/startswat.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/packaging/SGI/startswat.sh b/packaging/SGI/startswat.sh
index c2fc9fb467d..2a0333020fb 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