Fix some minor error at script output.

This commit is contained in:
Christoph 2018-01-02 14:49:03 +01:00
parent e815df3653
commit e9fdd42ce6

View File

@ -110,7 +110,7 @@ info (){
}
echo_done() {
if $terminal && $LOGGING ; then
if $terminal ; then
echo -e "\033[75G[ \033[32mdone\033[m ]"
fi
}
@ -182,18 +182,18 @@ if [[ -z "$PIDS" ]];then
error "Samba Service seems to be down. Try to (re)start .."
echononl "Stop Samba Service first .."
echononl " Stop Samba Service first .."
if [[ -n "$SYSTEMD_UNIT_FILE" ]] ; then
systemctl stop $SYSTEMD_UNIT_FILE > /dev/null 2>&1
if [[ $? -eq 0 ]] ; then
echo_ok
echo_done
else
echo_failed
fi
else
/etc/init.d/$SYSY_INIT_SCRIPT stop > /dev/null 2>&1
if [[ $? -eq 0 ]] ; then
echo_ok
echo_done
else
echo_failed
fi
@ -201,18 +201,18 @@ if [[ -z "$PIDS" ]];then
sleep 2
echononl "Start Samba Service .."
echononl " Start Samba Service .."
if [[ -n "$SYSTEMD_UNIT_FILE" ]] ; then
systemctl start $SYSTEMD_UNIT_FILE > /dev/null 2>&1
if [[ $? -eq 0 ]] ; then
echo_ok
echo_done
else
echo_failed
fi
else
/etc/init.d/$SYSY_INIT_SCRIPT start > /dev/null 2>&1
if [[ $? -eq 0 ]] ; then
echo_ok
echo_done
else
echo_failed
fi
@ -232,15 +232,21 @@ if [[ -z "$PIDS" ]];then
else
NEW_PIDS=""
for _pid in $NEW_PIDS ; do
NEW_PIDS="$PIDS $_pid"
count=0
for _pid in $PIDS ; do
if [[ $count -eq 1 ]] ; then
NEW_PIDS="$_pid"
else
NEW_PIDS="$NEW_PIDS $_pid"
fi
((count++))
done
info "the new PIDs are $NEW_PIDS"
echo ""
echo " Samba Service was restarted and is now up and running."
echo " The new PIDs are $NEW_PIDS"
echo "[ Success ]: Samba Service was restarted and is now up and running."
echo " The new PIDs are $NEW_PIDS"
echo ""
fi