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

Commit

Permalink
Re-instated deprecated functions (Commented out)
Browse files Browse the repository at this point in the history
Moved all new functions to end of script
  • Loading branch information
Duncan McCracken committed Jun 12, 2017
1 parent 90b2479 commit 6271d0e
Showing 1 changed file with 75 additions and 69 deletions.
144 changes: 75 additions & 69 deletions webadmin/var/www/webadmin/scripts/adminHelper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,15 @@ service avahi-daemon restart 2>&-
;;

# Admin services commands
getsmbstatus)
SERVICE=smbd
if [ -e "/etc/system-release" ]; then
SERVICE=smb
fi
if service $SERVICE status 2>&- | grep -q running ; then
echo "true"
else
echo "false"
fi
;;
#restartsmb)
#if [ "$(which update-rc.d 2>&-)" != '' ]; then
# SERVICE=smbd
#fi
#if [ "$(which chkconfig 2>&-)" != '' ]; then
# SERVICE=smb
#fi
#service $SERVICE restart 2>&-
#;;

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

stopsmb)
if [ "$(which update-rc.d 2>&-)" != '' ]; then
SERVICE=smbd
if [ "$(which systemctl 2>&-)" != '' ]; then
update-rc.d $SERVICE disable > /dev/null 2>&1
else
echo manual > /etc/init/$SERVICE.override
fi
fi
if [ "$(which chkconfig 2>&-)" != '' ]; then
SERVICE=smb
chkconfig $SERVICE off > /dev/null 2>&1
fi
service $SERVICE stop 2>&-
;;

getafpstatus)
SERVICE=afpd
if ps acx | grep -v grep | grep -q $SERVICE ; then
echo "true"
else
echo "false"
fi
;;

startafp)
SERVICE=netatalk
if [ "$(which update-rc.d 2>&-)" != '' ]; then
update-rc.d $SERVICE enable > /dev/null 2>&1
fi
if [ "$(which chkconfig 2>&-)" != '' ]; then
chkconfig $SERVICE on > /dev/null 2>&1
fi
service $SERVICE start 2>&-
;;

stopafp)
SERVICE=netatalk
if [ "$(which update-rc.d 2>&-)" != '' ]; then
update-rc.d $SERVICE disable > /dev/null 2>&1
fi
if [ "$(which chkconfig 2>&-)" != '' ]; then
chkconfig $SERVICE off > /dev/null 2>&1
fi
service $SERVICE stop 2>&-
rm -rf /srv/NetBootClients/*
;;
#restartafp)
#SERVICE=netatalk
#service $SERVICE restart 2>&-
#rm -rf /srv/NetBootClients/*
#;;

getnbimages)
IFS=$'\n'
Expand Down Expand Up @@ -385,17 +341,6 @@ fi
service slapd stop 2>&-
;;

installslapdconf)
if [ -d "/etc/ldap" ]; then
mv /etc/ldap/slapd.conf /etc/ldap/slapd.conf.bak
mv /var/appliance/conf/slapd.conf.new /etc/ldap/slapd.conf
fi
if [ -d "/etc/openldap" ]; then
mv /etc/openldap/slapd.conf /etc/openldap/slapd.conf.bak
mv /var/appliance/conf/slapd.conf.new /etc/openldap/slapd.conf
fi
;;

enableproxy)
if [ "$(which update-rc.d 2>&-)" != '' ]; then
update-rc.d slapd enable > /dev/null 2>&1
Expand Down Expand Up @@ -1045,6 +990,67 @@ if [ "$log_path" != '' ]; then
fi
;;

# Services commands
getsmbstatus)
SERVICE=smbd
if [ -e "/etc/system-release" ]; then
SERVICE=smb
fi
if service $SERVICE status 2>&- | grep -q running ; then
echo "true"
else
echo "false"
fi
;;

stopsmb)
if [ "$(which update-rc.d 2>&-)" != '' ]; then
SERVICE=smbd
if [ "$(which systemctl 2>&-)" != '' ]; then
update-rc.d $SERVICE disable > /dev/null 2>&1
else
echo manual > /etc/init/$SERVICE.override
fi
fi
if [ "$(which chkconfig 2>&-)" != '' ]; then
SERVICE=smb
chkconfig $SERVICE off > /dev/null 2>&1
fi
service $SERVICE stop 2>&-
;;

getafpstatus)
SERVICE=afpd
if ps acx | grep -v grep | grep -q $SERVICE ; then
echo "true"
else
echo "false"
fi
;;

startafp)
SERVICE=netatalk
if [ "$(which update-rc.d 2>&-)" != '' ]; then
update-rc.d $SERVICE enable > /dev/null 2>&1
fi
if [ "$(which chkconfig 2>&-)" != '' ]; then
chkconfig $SERVICE on > /dev/null 2>&1
fi
service $SERVICE start 2>&-
;;

stopafp)
SERVICE=netatalk
if [ "$(which update-rc.d 2>&-)" != '' ]; then
update-rc.d $SERVICE disable > /dev/null 2>&1
fi
if [ "$(which chkconfig 2>&-)" != '' ]; then
chkconfig $SERVICE off > /dev/null 2>&1
fi
service $SERVICE stop 2>&-
rm -rf /srv/NetBootClients/*
;;

# System Information
getName)
if [ -e "/etc/os-release" ]; then
Expand Down

0 comments on commit 6271d0e

Please sign in to comment.