12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #!/bin/sh
- set -e
- init()
- {
- /usr/sbin/sshd
- }
- loadStart()
- {
- dir=/entrypoint/
- loop=$(ls -l $dir |awk '{print $9}')
- for i in $loop
- do
- source $dir$i
- done
- }
- start()
- {
- loadStart
- if [[ $1 =~ "-" ]]; then
- OLD_IFS="$IFS"
- IFS="-"
- arr=($1)
- IFS="$OLD_IFS"
- start="start_${arr[0]}"
- echo $start
- eval $start ${arr[1]}
- else
- start="start_$1"
- echo $start
- eval $start
- fi
- }
- init
- if [ "$1" != "sh" ]; then
- for args in $@
- do
- start $args
- echo -e "\n"
- done
- fi
- jps
- netstat -apn
- exec sh
|