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