2020-11-27 11:02:47 +00:00
|
|
|
[ -x /bin/more ] || [ -x /usr/bin/more ] || alias more=less
|
2019-05-02 18:24:27 +00:00
|
|
|
[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
|
|
|
|
|
|
|
|
alias ll='ls -alF --color=auto'
|
|
|
|
|
|
|
|
[ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc
|
|
|
|
|
|
|
|
[ -x /usr/bin/arp -o -x /sbin/arp ] || arp() { cat /proc/net/arp; }
|
|
|
|
[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
|
|
|
|
|
|
|
|
service() {
|
2020-10-12 22:03:15 +00:00
|
|
|
if [ -f "/etc/init.d/$1" ]; then
|
|
|
|
/etc/init.d/$@
|
|
|
|
else
|
|
|
|
echo "Usage: service <service> [command]"
|
|
|
|
if [ -n "$1" ]; then
|
|
|
|
echo "Service "'"'"$1"'"'" not found, the following services are available:"
|
|
|
|
else
|
|
|
|
echo "The following services are available:"
|
|
|
|
fi
|
|
|
|
for F in /etc/init.d/* ; do
|
|
|
|
printf "%-30s\t%10s\t%10s\n" "$F" \
|
|
|
|
$( $($F enabled) && echo "enabled" || echo "disabled" ) \
|
|
|
|
$( [ "$(ubus call service list "{ 'verbose': true, 'name': '$(basename $F)' }" \
|
2021-05-12 10:44:32 +00:00
|
|
|
| jsonfilter -q -e "@['$(basename $F)'].instances[*].running" | uniq)" = "true" ] \
|
2020-10-12 22:03:15 +00:00
|
|
|
&& echo "running" || echo "stopped" )
|
|
|
|
done;
|
2019-05-02 18:24:27 +00:00
|
|
|
return 1
|
2020-10-12 22:03:15 +00:00
|
|
|
fi
|
2019-05-02 18:24:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[ -n "$KSH_VERSION" -o \! -s "$HOME/.shinit" ] || . "$HOME/.shinit"
|
|
|
|
[ -z "$KSH_VERSION" -o \! -s "$HOME/.mkshrc" ] || . "$HOME/.mkshrc"
|