Skip to content
This repository was archived by the owner on Mar 23, 2021. It is now read-only.

Commit 6271d0e

Browse files
Re-instated deprecated functions (Commented out)
Moved all new functions to end of script
1 parent 90b2479 commit 6271d0e

File tree

1 file changed

+75
-69
lines changed

1 file changed

+75
-69
lines changed

webadmin/var/www/webadmin/scripts/adminHelper.sh

+75-69
Original file line numberDiff line numberDiff line change
@@ -190,17 +190,15 @@ service avahi-daemon restart 2>&-
190190
;;
191191

192192
# Admin services commands
193-
getsmbstatus)
194-
SERVICE=smbd
195-
if [ -e "/etc/system-release" ]; then
196-
SERVICE=smb
197-
fi
198-
if service $SERVICE status 2>&- | grep -q running ; then
199-
echo "true"
200-
else
201-
echo "false"
202-
fi
203-
;;
193+
#restartsmb)
194+
#if [ "$(which update-rc.d 2>&-)" != '' ]; then
195+
# SERVICE=smbd
196+
#fi
197+
#if [ "$(which chkconfig 2>&-)" != '' ]; then
198+
# SERVICE=smb
199+
#fi
200+
#service $SERVICE restart 2>&-
201+
#;;
204202

205203
startsmb)
206204
if [ "$(which update-rc.d 2>&-)" != '' ]; then
@@ -218,53 +216,11 @@ fi
218216
service $SERVICE start 2>&-
219217
;;
220218

221-
stopsmb)
222-
if [ "$(which update-rc.d 2>&-)" != '' ]; then
223-
SERVICE=smbd
224-
if [ "$(which systemctl 2>&-)" != '' ]; then
225-
update-rc.d $SERVICE disable > /dev/null 2>&1
226-
else
227-
echo manual > /etc/init/$SERVICE.override
228-
fi
229-
fi
230-
if [ "$(which chkconfig 2>&-)" != '' ]; then
231-
SERVICE=smb
232-
chkconfig $SERVICE off > /dev/null 2>&1
233-
fi
234-
service $SERVICE stop 2>&-
235-
;;
236-
237-
getafpstatus)
238-
SERVICE=afpd
239-
if ps acx | grep -v grep | grep -q $SERVICE ; then
240-
echo "true"
241-
else
242-
echo "false"
243-
fi
244-
;;
245-
246-
startafp)
247-
SERVICE=netatalk
248-
if [ "$(which update-rc.d 2>&-)" != '' ]; then
249-
update-rc.d $SERVICE enable > /dev/null 2>&1
250-
fi
251-
if [ "$(which chkconfig 2>&-)" != '' ]; then
252-
chkconfig $SERVICE on > /dev/null 2>&1
253-
fi
254-
service $SERVICE start 2>&-
255-
;;
256-
257-
stopafp)
258-
SERVICE=netatalk
259-
if [ "$(which update-rc.d 2>&-)" != '' ]; then
260-
update-rc.d $SERVICE disable > /dev/null 2>&1
261-
fi
262-
if [ "$(which chkconfig 2>&-)" != '' ]; then
263-
chkconfig $SERVICE off > /dev/null 2>&1
264-
fi
265-
service $SERVICE stop 2>&-
266-
rm -rf /srv/NetBootClients/*
267-
;;
219+
#restartafp)
220+
#SERVICE=netatalk
221+
#service $SERVICE restart 2>&-
222+
#rm -rf /srv/NetBootClients/*
223+
#;;
268224

269225
getnbimages)
270226
IFS=$'\n'
@@ -385,17 +341,6 @@ fi
385341
service slapd stop 2>&-
386342
;;
387343

388-
installslapdconf)
389-
if [ -d "/etc/ldap" ]; then
390-
mv /etc/ldap/slapd.conf /etc/ldap/slapd.conf.bak
391-
mv /var/appliance/conf/slapd.conf.new /etc/ldap/slapd.conf
392-
fi
393-
if [ -d "/etc/openldap" ]; then
394-
mv /etc/openldap/slapd.conf /etc/openldap/slapd.conf.bak
395-
mv /var/appliance/conf/slapd.conf.new /etc/openldap/slapd.conf
396-
fi
397-
;;
398-
399344
enableproxy)
400345
if [ "$(which update-rc.d 2>&-)" != '' ]; then
401346
update-rc.d slapd enable > /dev/null 2>&1
@@ -1045,6 +990,67 @@ if [ "$log_path" != '' ]; then
1045990
fi
1046991
;;
1047992

993+
# Services commands
994+
getsmbstatus)
995+
SERVICE=smbd
996+
if [ -e "/etc/system-release" ]; then
997+
SERVICE=smb
998+
fi
999+
if service $SERVICE status 2>&- | grep -q running ; then
1000+
echo "true"
1001+
else
1002+
echo "false"
1003+
fi
1004+
;;
1005+
1006+
stopsmb)
1007+
if [ "$(which update-rc.d 2>&-)" != '' ]; then
1008+
SERVICE=smbd
1009+
if [ "$(which systemctl 2>&-)" != '' ]; then
1010+
update-rc.d $SERVICE disable > /dev/null 2>&1
1011+
else
1012+
echo manual > /etc/init/$SERVICE.override
1013+
fi
1014+
fi
1015+
if [ "$(which chkconfig 2>&-)" != '' ]; then
1016+
SERVICE=smb
1017+
chkconfig $SERVICE off > /dev/null 2>&1
1018+
fi
1019+
service $SERVICE stop 2>&-
1020+
;;
1021+
1022+
getafpstatus)
1023+
SERVICE=afpd
1024+
if ps acx | grep -v grep | grep -q $SERVICE ; then
1025+
echo "true"
1026+
else
1027+
echo "false"
1028+
fi
1029+
;;
1030+
1031+
startafp)
1032+
SERVICE=netatalk
1033+
if [ "$(which update-rc.d 2>&-)" != '' ]; then
1034+
update-rc.d $SERVICE enable > /dev/null 2>&1
1035+
fi
1036+
if [ "$(which chkconfig 2>&-)" != '' ]; then
1037+
chkconfig $SERVICE on > /dev/null 2>&1
1038+
fi
1039+
service $SERVICE start 2>&-
1040+
;;
1041+
1042+
stopafp)
1043+
SERVICE=netatalk
1044+
if [ "$(which update-rc.d 2>&-)" != '' ]; then
1045+
update-rc.d $SERVICE disable > /dev/null 2>&1
1046+
fi
1047+
if [ "$(which chkconfig 2>&-)" != '' ]; then
1048+
chkconfig $SERVICE off > /dev/null 2>&1
1049+
fi
1050+
service $SERVICE stop 2>&-
1051+
rm -rf /srv/NetBootClients/*
1052+
;;
1053+
10481054
# System Information
10491055
getName)
10501056
if [ -e "/etc/os-release" ]; then

0 commit comments

Comments
 (0)