Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../././../lib/svc/method/pflog
Real path: /lib/svc/method/pflog
Zurück
#!/sbin/sh # # # # # Copyright (c) 2014, 2020, Oracle and/or its affiliates. # . /lib/svc/share/smf_include.sh PATH=$PATH:/usr/sbin # Retrieve an unescaped property value from a method token. # Arguments: # - raw method token value # Outputs: # - unescaped property value # Returns: # - 0 on success # - 1 when unescaping failed # - 2 when the value is empty function get_property { VALUE="$(echo "$1" | /usr/bin/sed 's/\\\(.\)/\1/g')" if [[ $? -ne 0 ]]; then exit 1 fi echo "$VALUE" } function failure { echo "An unknown error occurred. Probably either /usr/bin/sed is" echo "missing or system resources are exhausted." exit $SMF_EXIT_ERR_FATAL } # store and unescape property values PFLOGD_LOGFILE="$(get_property "$2")" || failure PFLOGD_SNAPLEN="$(get_property "$3")" || failure PFLOGD_IFACE="$(get_property "$4")" || failure PFLOGD_DELAY="$(get_property "$5")" || failure PFLOGD_FILTER="$(get_property "$6")" || failure # check property values for emptiness (pflog/filter may be empty) if [[ -z $PFLOGD_LOGFILE ]]; then echo "The pflog/logfile property cannot be empty." exit $SMF_EXIT_ERR_FATAL fi if [[ -z $PFLOGD_SNAPLEN ]]; then echo "The pflog/snaplen property cannot be empty." exit $SMF_EXIT_ERR_FATAL fi if [[ -z $PFLOGD_IFACE ]]; then echo "The pflog/interface property cannot be empty." exit $SMF_EXIT_ERR_FATAL fi if [[ -z $PFLOGD_DELAY ]]; then echo "The pflog/delay property cannot be empty." exit $SMF_EXIT_ERR_FATAL fi case "$1" in start) # Create non-persistent capture link if it does not exist. echo "Checking if capture link exists.." dladm show-cap "$PFLOGD_IFACE" if [[ $? -ne 0 ]] ; then echo "Creating a temporary capture link.." dladm create-cap -t "$PFLOGD_IFACE" if [ $? -ne 0 ] ; then exit $SMF_EXIT_ERR_FATAL fi fi # Start the daemon. smf_clear_env pflogd -i "$PFLOGD_IFACE" -s "$PFLOGD_SNAPLEN" \ -f "$PFLOGD_LOGFILE" -d "$PFLOGD_DELAY" "$PFLOGD_FILTER" if [[ $? -ne 0 ]] ; then exit $SMF_EXIT_ERR_FATAL fi ;; *) echo "Usage: $0 \c" >&2 echo "(start)" >&2 exit 1 ;; esac exit $SMF_EXIT_OK