You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
calculate-utils-2.1-client/data/client

52 lines
1.5 KiB

#!/sbin/runscript
# Copyright 2008-2010 Mir Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
depend() {
use localmount
after bootmisc consolefont modules netmount
after readahead-list ypbind autofs openvpn gpm lircmd
after cupsd fbcondecor sshd cron wicd
before xdm
after acpid consolekit hald xfs
}
start() {
# Mount remote Samba filesystems.
ebegin "Mounting domain resources"
# Identifing domain server by env file
local env_file=/var/calculate/calculate.env
if [[ -f $env_file ]]
then
local SERVER=$( sed -rn 's/^cl_remote_host\s*=\s*(\S+)$/\1/p' $env_file )
for COUNT in $( seq 0 20 )
do
ping -w2 -c1 $SERVER &>/dev/null && break || sleep 1
done
fi
cl-client --mount
eend $? "Some samba remote resources to mount"
}
stop(){
ebegin "Unmount domain resources"
[[ $( mount | grep ' /var/calculate/remote ' ) ]] &&
umount /var/calculate/remote
[[ $( mount | grep '/var/calculate/client-home on /home ' ) ]] &&
umount /home
eend 0
}
# vim:ts=4