Highlighted
Absent Member.
Absent Member.
489 views

[DP5.1] Custom Mount.sh

Hi everyone,
I want to modify the script Mount.sh to notify the email of the mount request state, wait 1 hour and if the device is confirmed let the session continue, if no it cancels the session.
Is it possible?

Regards...
PSS
4 Replies
Highlighted
Absent Member.
Absent Member.

Hi,
I have not tried but I think it is possible. You can try to modify the default Mount.sh as follow:

- "sleep" one hour after the mail is sent "sleep 3600".

- After one hour, check the status of the session "omnistat".

- If the session still is in mount state, abort the session "omniabort".

- If the session is running or, has completed, do nothing and exit.

You have not mentioned your OS, there is no "sleep" command in Windows (DOS) but, there is Windows versions of sleep avialable as freeware.

Highlighted
Absent Member.
Absent Member.

The os is hpux.
How can I check the stat using Mount.sh script?
0 Likes
Highlighted
Absent Member.
Absent Member.

Hi,
Something like:

STATUS=$(omnistat -session $SESSIONKEY | awk 'BEGIN { getline ; getline } { print $3 }' )

case $STATUS in

Mount)
omniabort -session $SESSIONKEY
;;
*)
exit 0
;;

esac



It is not tested, it may need some trial end error before you get it working.
0 Likes
Highlighted
Absent Member.
Absent Member.

Sorry,

You should use the -status_only option:

omnistat -session $SESSIONKEY -status_only |awk ...
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.