Jump to content
Форум по продукции MOXA

Вот ещё... возможно и глупость


Recommended Posts

Всё время у себя на PC набираю типа

service apache2 restart

а на UC-7112LX-Plus:

/etc/init.d/apache restart

Вот и сделал этот "service"

#!/bin/bash
#

cmd=$1
par1=$2
par2=$3
par3=$4
par4=$5

if ! [ ${#cmd} -eq 0 ]; then
str="/etc/init.d/$cmd $par1 $par2 $par3 $par4"
$str
fi

положил его в /sbin/service и дал права chmod +x /sbin/service

теперь всё, что в /etc/init.d/ можно запускать например так:


kto@debian:~/coding/bash$ ssh www-data@192.168.0.240
www-data@192.168.0.240's password: 

    ####        ####    ######    ####### ######      ##
     ###       ####   ###    ###    ####   ####      ###
      ###      ###   ###      ###    ###    ##       ###
      ###     ####   ##        ##    ###   #         ####
      ####    # ##  ###        ###    ### ##        ## ##
     ## ##    # ##  ###         ##     ####         #  ##
     ## ###  ## ##  ##          ##     ####         #  ###
     ##  ##  #  ##  ##          ##      ###        #######
     ##  ##  #  ##  ###        ###     #####       #    ##
     ##   ###   ##  ###        ###    ##  ###      #    ###
     ##   ###   ##   ##        ##    ##    ###    ##     ##
     ##   ###   ##    ##      ##     #     ###    #      ##
   ######  #  ######   ########   ####### ###########  ######

For further information check:
http://www.moxa.com/

You are using Moxa embedded computer.
-sh: /home/httpd/.profile: is a directory
www-data@Moxa:~$ su
Password: 
root@Moxa:~# service apache restart
Stopping web server: apache.
Starting web server: apache.
root@Moxa:~#

тут рестарт apache на устройстве

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...