Help with a startup script for monitorix

How can I deal with a perl script that doesn't acknowledge a query for pidof?
$ ps aux | grep monitorix
root 1089 0.0 1.2 16280 6556 ? Ss 09:54 0:00 /usr/bin/monitorix -c /etc/monitorix.conf
So it's running... but I can't find it with pidof:
$ pidof /usr/bin/monitorix
Here is the /etc/rc.d/monitorix I've been using but that doesn't stop the program (since it has no PID).
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
PID=`pidof -o %PPID /usr/bin/monitorix`
MARGS="-c /etc/monitorix.conf"
case "$1" in
start)
stat_busy "Starting Monitorix"
if [ -z "$PID" ]; then
/usr/bin/monitorix $MARGS
fi
if [ ! -z "$PID" -o $? -gt 0 ]; then
stat_fail
else
PID=`pidof -o %PPID /usr/bin/monitorix`
echo $PID > /var/run/monitorix.pid
add_daemon monitorix
stat_done
fi
stop)
stat_busy "Stopping Monitorix"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon monitorix
else
rm_daemon monitorix
stat_done
fi
restart)
$0 stop
sleep 1
$0 start
echo "usage: $0 {start|stop|restart}"
esac

According to the man page, the -p flag will let you generate a PID file.
You have a few logical errors in your rc.d script and a syntax error (double else in stop). I've been using a template similar to the below in cleaning up a few of the packages I maintain...
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
pidfile=/run/monitorix.pid
if [[ -r $pidfile ]]; then
read -r PID < "$pidfile"
if [[ ! -d /proc/$PID ]]; then
# stale pidfile
unset PID
rm -f "$pidfile"
fi
fi
args=(-c /etc/monitorix.conf -p "$pidfile")
case "$1" in
start)
stat_busy "Starting Monitorix"
if [[ -z $PID ]] && /usr/bin/monitorix "${args[@]}"; then
add_daemon monitorix
stat_done
else
stat_fail
exit 1
fi
stop)
stat_busy "Stopping Monitorix"
if [[ $PID ]] && kill $PID &> /dev/null; then
rm_daemon monitorix
stat_done
else
stat_fail
exit 1
fi
restart)
$0 stop
sleep 1
$0 start
echo "usage: $0 {start|stop|restart}"
esac
please also fix the PKGBUILD:
install=('readme.install')
This is not valid, and pacman 4 will not let you declare install as an array.
Last edited by falconindy (2011-09-25 15:05:02)

Similar Messages

  • [solved]Need help with a bash script for MOC conky artwork.

    I need some help with a bash script for displaying artwork from MOC.
    Music folders have a file called 'front.jpg' in them, so I need to pull the current directory from MOCP and then display the 'front.jpg' file in conky.
    mocp -Q %file
    gives me the current file playing, but I need the directory (perhaps some way to use only everything after the last  '/'?)
    A point in the right direction would be appreciated.
    thanks, d
    Last edited by dgz (2013-08-29 21:24:28)

    Xyne wrote:
    You should also quote the variables and output in double quotes to make the code robust, e.g.
    filename="$(mocp -Q %file)"
    dirname="${filename%/*}"
    cp "$dirname"/front.jpg ~/backup/art.jpg
    Without the quotes, whitespace will break the code. Even if you don't expect whitespace in any of the paths, it's still good coding practice to include the quotes imo.
    thanks for the tip.
    here it is, anyhow:
    #!/bin/bash
    filename=$(mocp -Q %file)
    dirname=${filename%/*}
    cp ${dirname}/front.jpg ~/backup/art.jpg
    then in conky:
    $alignr${execi 30 ~/bin/artc}${image ~/backup/art.jpg -s 100x100 -p -3,60}
    thanks for the help.
    Last edited by dgz (2013-08-29 21:26:32)

  • Help with first Adobe Script for AE?

    Hey,
    I'm trying to create a script that will allow me to set a certain number of layer markers at an even interval to mark out a song. Could someone help me troubleshoot this script? I've been working on it for ages now, and I'm about to snap. I've basically gone from HTML and CSS, to javascript and Adobe scripting in the past few hours, and I cannot figure this out for the life of me.
    I want to create a dialog with two fields, the number of markers to place, and the tempo of the song. Tempo is pretty simple, its just the number of beats per minute. The script is meant to start at a marker that I have already placed, and set a new marker at incrementing times. Its mainly to help me see what I'm trying to animate too, even if the beat is a little hard to pick up every once in a while.
    Also, is there a better way to do this? This script will help me in the long run because I will need to do this pretty often, but I'm wondering if there was something that I could not find online that would have saved me these hours of brain-jumbling?
    Thank you very much for any help you can offer.
        // Neo_Add_MultiMarkers.jsx
        //jasondrey13
        //2009-10-26
        //Adds multiple markers to the selected layer.
        // This script prompts for a certain number of layer markers to add to the selected audio layer,
        //and an optional "frames between" to set the number of frames that should be skipped before placing the next marker
        // It presents a UI with two text entry areas: a Markers box for the
        // number of markers to add and a Frames Between box for the number of frames to space between added markers.
        // When the user clicks the Add Markers button,
        // A button labeled "?" provides a brief explanation.
        function Neo_Add_MultiMarkers(thisObj)
            // set vars
            var scriptName = "Neoarx: Add Multiple Markers";
            var numberOfMarkers = "0";
            var tempo = "0";
            // This function is called when the Find All button is clicked.
            // It changes which layers are selected by deselecting layers that are not text layers
            // or do not contain the Find Text string. Only text layers containing the Find Text string
            // will remain selected.
            function onAddMarkers()
                // Start an undo group.  By using this with an endUndoGroup(), you
                // allow users to undo the whole script with one undo operation.
                app.beginUndoGroup("Add Multiple Markers");
                // Get the active composition.
                var activeItem = app.project.activeItem;
                if (activeItem != null && (activeItem instanceof CompItem)){
                    // Check each selected layer in the active composition.
                    var activeComp = activeItem;
                    var layers = activeComp.selectedLayers;
                    var markers = layers.property("marker");
                    //parse ints
                    numberOfMarkers = parseInt (numberOfMarkers);
                    tempo = parseInt (tempo);
                    // Show a message and return if there is no value specified in the Markers box.
                    if (numberOfMarkers < 1 || tempo < 1) {
                    alert("Each box can take only positive values over 1. The selection was not changed.", scriptName);
                    return;
                    if (markers.numKeys < 1)
                    alert('Please set a marker where you would like me to begin.');
                    return;
                    var beginTime = markers.keyTime( 1 );
                    var count = 1;
                    var currentTime = beginTime;
                    var addPer = tempo/60;
                    while(numberOfMarkers < count)
                    markers.setValueAtTime(currentTime, MarkerValue(count));
                    currentTime = currentTime + addPer;
                    if (count==numberOfMarkers) {
                        alert('finished!');
                        return;
                    else{
                        count++;
                app.endUndoGroup();
        // Called when the Markers Text string is edited
            function onMarkersStringChanged()
                numberOfMarkers = this.text;
            // Called when the Frames Text string is edited
            function onFramesStringChanged()
                tempo = this.text;
            // Called when the "?" button is clicked
            function onShowHelp()
                alert(scriptName + ":\n" +
                "This script displays a palette with controls for adding a given number of markers starting at a pre-placed marker, each separated by an amount of time determined from the inputted Beats Per Minute (Tempo).\n" +
                "It is designed to mark out the even beat of a song for easier editing.\n" +
                "\n" +
                "Type the number of Markers you would like to add to the currently selected layer. Type the tempo of your song (beats per minute).\n" +           
                "\n" +
                "Note: This version of the script requires After Effects CS3 or later. It can be used as a dockable panel by placing the script in a ScriptUI Panels subfolder of the Scripts folder, and then choosing this script from the Window menu.\n", scriptName);
            // main:
            if (parseFloat(app.version) < 8)
                alert("This script requires After Effects CS3 or later.", scriptName);
                return;
            else
                // Create and show a floating palette
                var my_palette = (thisObj instanceof Panel) ? thisObj : new Window("palette", scriptName, undefined, {resizeable:true});
                if (my_palette != null)
                    var res =
                    "group { \
                        orientation:'column', alignment:['fill','fill'], alignChildren:['left','top'], spacing:5, margins:[0,0,0,0], \
                        markersRow: Group { \
                            alignment:['fill','top'], \
                            markersStr: StaticText { text:'Markers:', alignment:['left','center'] }, \
                            markersEditText: EditText { text:'0', characters:10, alignment:['fill','center'] }, \
                        FramesRow: Group { \
                            alignment:['fill','top'], \
                            FramesStr: StaticText { text:'Tempo:', alignment:['left','center'] }, \
                            FramesEditText: EditText { text:'140', characters:10, alignment:['fill','center'] }, \
                        cmds: Group { \
                            alignment:['fill','top'], \
                            addMarkersButton: Button { text:'Add Markers', alignment:['fill','center'] }, \
                            helpButton: Button { text:'?', alignment:['right','center'], preferredSize:[25,20] }, \
                    my_palette.margins = [10,10,10,10];
                    my_palette.grp = my_palette.add(res);
                    // Workaround to ensure the editext text color is black, even at darker UI brightness levels
                    var winGfx = my_palette.graphics;
                    var darkColorBrush = winGfx.newPen(winGfx.BrushType.SOLID_COLOR, [0,0,0], 1);
                    my_palette.grp.markersRow.markersEditText.graphics.foregroundColor = darkColorBrush;
                    my_palette.grp.FramesRow.FramesEditText.graphics.foregroundColor = darkColorBrush;
                    my_palette.grp.markersRow.markersStr.preferredSize.width = my_palette.grp.FramesRow.FramesStr.preferredSize.width;
                    my_palette.grp.markersRow.markersEditText.onChange = my_palette.grp.markersRow.markersEditText.onChanging = onMarkersStringChanged;
                    my_palette.grp.FramesRow.FramesEditText.onChange = my_palette.grp.FramesRow.FramesEditText.onChanging = onFramesStringChanged;
                    my_palette.grp.cmds.addMarkersButton.onClick    = onAddMarkers;
                    my_palette.grp.cmds.helpButton.onClick    = onShowHelp;
                    my_palette.layout.layout(true);
                    my_palette.layout.resize();
                    my_palette.onResizing = my_palette.onResize = function () {this.layout.resize();}
                    if (my_palette instanceof Window) {
                        my_palette.center();
                        my_palette.show();
                    } else {
                        my_palette.layout.layout(true);
                else {
                    alert("Could not open the user interface.", scriptName);
        Neo_Add_MultiMarkers(this);

    You should ask such questions over at AEnhancers. I had a quick look at your code but could not find anything obvious, so it may relate to where and when you execute certain functions and how they are nested, I just don't have the time to do a deeper study.
    Mylenium

  • Help with a shell script for schroot

    Since I replaced dchroot with schroot I have a problem.
    In /usr/bin I have a script run32.sh to run 32 bit applications, and symbolic links like acroread32 pointing to run32.sh, firefox32 pointing to run32.sh etc.
    Here is the run32.sh I had before
    #!/bin/bash
    cmd=`basename $0 | sed -n s/32//p`
    for (( i=1; $i<=$#; i=$i+1 )); do
    esc[$i]=$(sed -e 's#\([^[:alnum:]]\)#\\\1#g' <<<${!i})
    done
    exec schroot -p "$cmd" "${esc[@]}"
    The for loop is a trick I stole from the web for escaping some characters.
    But this is not working anymore with schroot.
    So I modified run32.sh like this:
    #!/bin/bash
    cmd=`basename $0 | sed -n s/32//p`
    ct=0
    arg=\"
    for i in "$@"
    do
    ct=$(($ct+1))
    if [ $ct -eq 1 ]
    then
    arg="$arg$i"
    else
    arg="$arg $i"
    fi
    done
    arg=$arg\"
    echo exec schroot -p $cmd $arg
    exec schroot -p $cmd $arg
    Notice that at the end I echo the exec command and then I execute it.
    It works fine for simple arguments, like
    acroread32 foo.pdf
    but not for composite arguments like
    acroread32 foo boo.pdf
    or
    acroread32 foo\ boo.pdf
    (this last one is when I use the tab key to complete the name of the file).
    The thing that I really don't understand is that, typing
    acroread32 foo boo.pdf
    the echoed command is
    exec schroot -p acroread "foo boo.pdf"
    and I get an error
    I: [Arch32-8398824e-10d9-4adf-a299-10c09116e262 chroot] Running command: "acroread foo boo.pdf"
    but then, if i type directly to the command line
    exec schroot -p acroread "foo boo.pdf"
    it opens the file!
    Has somebody a solution to deal both with files like "foo.pdf" and "foo boo.pdf"?

    jacko wrote:Is there any reason your choosing to use acroread over some other form of pdf viewer via a chroot?
    Usually I use kpdf but for some particular features acroread is better. But it's not the point, acroread is just an example. You can do another example with firefox 32 bit, that I use for flash and jre, and mplayer 32 bit, that I use for some win32 codecs.

  • Check for libraries with a startup script

    Is it possible to check for open libraries with a startup script?  Currently, i'm trying like this:
    try{
         app.libraries.item("Marks.indl").name
    catch(e){
         app.open(File("/Support/InDesign/Lib/Marks.indl"))
    If InDesign is already open, this code works correctly (that is, if the library is open, nothing happens, otherwise it opens the library).  However, if I place this in the startup script folder, it will open a second (third, fourth, etc.) copy of the library, even if the library is already open.
    I think this happens because the library files are opened later in the startup sequence then the startup scripts are run.  Is there any way to work around this?
    Thanks,
    /dan

    Is your script supposed to work in ID CS3, or later?
    Anyway, InDesign CS4 seems to reopen the libraries before launching startup scripts, so the following code works for me:
    // Startup Script
    const libName = "Marks.indl",
      libPath = "/Support/InDesign/Lib/";
    var libFile = libPath + libName;
    if( !app.libraries.itemByName(libName).isValid )
      try {app.open(File(libFile))}
      catch(_){alert("Unable to open the library:\r"+libFile);}
    @+
    Marc

  • Startup Scripts for OBIEE 11g on Linux

    Hi, I originally spent many hours trying to find a startup/shutdown script for OBIEE on linux, in the end I compiled a new one based on notes in the install manual and other posts on the subject until I got it working consistantly
    Please add comments or improvements :)
    Note: you need to create the boot.properties file (in /security) for each server, and provide the username/password so WebLogic won't prompt for it when starting automatically (otherwise it doesn't start :p) ....refer to the install manual or [weblogic boot.properties|http://onlineappsdba.com/index.php/2010/08/21/weblogic-startup-prompting-from-username-password-bootproperties/]
    #!/bin/bash
    # /etc/init.d/obiee
    # Run-level Startup script for OBIEE
    # set required paths
    export ORACLE_BASE=/opt/oracle
    export ORACLE_HOME=/opt/oracle/product/11.1.0/db_1
    export ORACLE_OWNR=oracle
    export ORACLE_FMW=/opt/oracle/product/fmw
    export PATH=$PATH:$ORACLE_FMW/bin
    case "$1" in
    start)
    echo -e "Starting Weblogic Server...."
    su $ORACLE_OWNR -c "$ORACLE_FMW/user_projects/domains/bifoundation_domain/bin/startWebLogic.sh > /dev/null 2>&1 &"
    sleep 30
    echo -e "Starting Node Manager..."
    su $ORACLE_OWNR -c "$ORACLE_FMW/wlserver_10.3/server/bin/startNodeManager.sh > /dev/null 2>&1 &"
    sleep 30
    echo -e "Starting Managed Server: bi_server1..."
    su $ORACLE_OWNR -c "$ORACLE_FMW/user_projects/domains/bifoundation_domain/bin/startManagedWebLogic.sh bi_server1 [url for admin console] > /dev/null 2>&1 &"
    sleep 30
    echo -e "Starting Components...."
    su $ORACLE_OWNR -c "$ORACLE_FMW/instances/instance1/bin/opmnctl startall > /dev/null 2>&1 &"
    sleep 30
    stop)
    echo -e "Stopping Components...."
    su $ORACLE_OWNR -c "$ORACLE_FMW/instances/instance1/bin/opmnctl stopall > /dev/null 2>&1 &"
    sleep 30
    echo -e "Stopping Managed Server: bi_server1..."
    su $ORACLE_OWNR -c "$ORACLE_FMW/user_projects/domains/bifoundation_domain/bin/stopManagedWebLogic.sh bi_server1 [url for admin console] [weblogic user] [weblogic pass] > /dev/null 2>&1 &"
    sleep 30
    echo -e "Stopping Weblogic Server...."
    su $ORACLE_OWNR -c "$ORACLE_FMW/user_projects/domains/bifoundation_domain/bin/stopWebLogic.sh > /dev/null 2>&1 &"
    sleep 15
    status)
    echo -e "Component Status...."
    su $ORACLE_OWNR -c "$ORACLE_FMW/instances/instance1/bin/opmnctl status"
    restart)
    $0 stop
    $0 start
    echo "Usage: `basename $0` start|stop|restart|status"
    exit 1
    esac
    exit 0
    Hopefully this helps others in the same situation
    Cheers

    HI,
    Is this script for Enterprise Install on a single computer? For Simple install I think there is no concept of nodemanager and managedserver.
    --Joe                                                                                                                                                                                                                                                                                                                           

  • Missing startup script for version cue

    I'm having the problem where I don't seem to have the startup scripts for version cue in bridge.
    When I check the list of startup scripts in preferences, the other scripts all seem to be there like for contribute, fireworkds etc. However version cue is missing.
    I also checked the actual locations for the startup scripts.
    The scripts for version cue seem to be in the actual locations but for some reason they're not running or showing up in bridge or that's what I'm assuming anyway.
    I'm running bridge CS4 and version cue CS4.
    If anyone could help me that would be great!

    What then do they recommend?  The URL listed below is broken/no longer available.  The solution listed above does appear to work.  I installed Version Cue Server CS4 after having installed the rest of the suite on my workstation.  I used drive to link to the server(my machine which I am using for testing).  I had CS3 on this machine before uninstalling it and installing CS4.
    Re: Missing startup script for version cue
    Matthew Laun wrote:
     Adobe recommends that you do not follow the steps above to enable Version Cue CS4 in Bridge CS4.
    Please see this thread for more details:
    http://www.adobeforums.com/webx/.59b6d12f

  • Oracle Startup Scripts for AIX

    Does anyone have experience setting up automatic Oracle startup scripts for AIX?
    Any help would be greatly appreciated!
    Thanks,
    Mike

    Some recommandation here :
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b15658/strt_stp.htm#sthref255
    Nicolas.

  • Need help with a activation code for Adobe Acrobat X Standard for my PC,, Don't have older version serial numbers,  threw programs away,  only have Adobe Acrobat X Standard,  need a code to unlock program?

    Need help with a activation code for Adobe Acrobat X Standard for my PC, Don't have older Version of Adobe Acrobat 9, 8 or 7. 

    You don't need to install the older version, you only need the serial number from your original purchase. If you don't have them to hand, did you register? If so, they should be in your Adobe account. If not you really need to contact Adobe, though it isn't clear they will be able to do anything without some proof of purchase etc.

  • I think I need help with driver (software) settings for D110a

    I think I need help with driver (software) settings for D110a all-in-one
    Product: D110a all-in-one
    OS: Windows XP Professional
    Error messages: None
    Changes before problem appeared: None--new installation
    The quality of photo images (mostly JPG files) in printouts is awful even though the files display beautifully on the PC screen. I am using
    IrfanView software for displaying/printing. As far as I can tell, IrfanView is not the problem.
    When I print the same images on a Deskjet 5150 attached to a different PC also running XP Pro and IrfanView, the quality of the printouts is at
    least acceptable, Some would probably say good or very good.
    It's dificult to explain in words the problem with the printouts. A picture of really pretty vegetables (squashes, tomatoes, watermelon, etc) comes
    out much too red. Moreover, the red, which appears shaded on the screen, seems to be all one shade in the D110a printouts.
    Something similar happens to a view of a huge tree in full leaf. On screen, there are subtle variations in the "greenness" of the leaves. In the
    printout, all green is the same shade. In the same printout, the trunk of the tree is all a single shade of grey. It isn;t even obvious that the
    trunk is a round, solid object.
    I liken the effect to audio that disappears entirely when you lower the volume and gets clipped into square waves in even moderately loud passages.
    I don't know whether the D110a driver software permits adjusting the parameters that appear to be set incorrectly, and if adjustments are possible,
    how I would identify which parameters to adjust, how I would access them, or how I would adjust them. I'm hoping that someone can help. Thanks.
    I forgot to mention that I have used the diagnostic application and it tells me that there are no problems.
    e-mail me at [email protected]

    brazzmonkey wrote:
    Hi everyone,
    I noticed the following message when network starts on my gateway
    Warning: This functionality is deprecated.
    Please refer to /etc/rc.conf on how to define a single wired
    connection, or use a utility such as netcfg.
    Then I realized the way network settings should be written in rc.conf has changed. But I can't figure out how this should be done.
    Currently, my set up is the following (old way):
    INTERFACES=(eth0 eth1)
    eth0="dhcp"
    eth1="eth1 192.168.0.10 netmask 255.255.255.0 broadcast 192.168.0.255"
    ROUTES=(!gateway)
    eth0 is on DHCP because the IP is dynamically assigned my ISP.
    eth1 has a fix IP because it's on the LAN side.
    No problem to use DHCP on eth0 with the new settings.
    But for eth1, I don't know what I am supposed to write for gateway.
    Wiki isn't clear on that one either, and it looks like many articles still refer to the old way.
    Any guidance appreciated, thanks.
    brazzmonkey,
    you can't define 2 interfaces the old way (even though I saw some tricky workaround somewhere in the forums).
    Use, f.e., netcfg:
    Comment your old lines.
    In /etc/rc.conf insert:
    NETWORKS=(Eth0-dhcp Eth1-static)
    DAEMONS=(..... !network @net-profiles ....)
    In /etc/network.d create 2 files:
    First one is named  Eth0-dhcp.
    Contents:
    CONNECTION="ethernet"
    DESCRIPTION="Whatever text"
    INTERFACE=eth0
    HOSTNAME="your hostname"
    IP="dhcp"
    DHCP_TIMEOUT=15
    Second one is named Eth1-static.
    Contents:
    CONNECTION='ethernet'
    DESCRIPTION='whatver'
    INTERFACE='eth1'
    HOSTNAME='hname'
    IP='static'
    ADDR='192.168.0.10'
    GATEWAY='192.168.0.1' # your gateway IP
    DNS=('192.168.0.1') # your DNS server
    The names Eth0-dhcp and Eth1-static are not magic. They just must be the same in rc.conf and in /etc/network.d.
    Hope it helps.
    mektub
    PS: netcfg must be installed.
    Last edited by Mektub (2011-07-20 14:07:05)

  • I need help with downgradeing my ios for my ipod touch 4th gen

    i need help with downgradeing my ios for my ipod touch 4th gen

    As has alwys been the case, you cannot go back.
    Sorry

  • Help needed with a PS script for network share documentation

    I found a nice PS script that will do what I want, however the output portion seems to be broken. It will output the permissions and details, but not list what share it is referring to... Can anyone help with this?
    Thanks!
    https://gallery.technet.microsoft.com/scriptcenter/List-Share-Permissions-83f8c419#content
    <# 
               .SYNOPSIS  
               This script will list all shares on a computer, and list all the share permissions for each share. 
               .DESCRIPTION 
               The script will take a list all shares on a local or remote computer. 
               .PARAMETER Computer 
               Specifies the computer or array of computers to process 
               .INPUTS 
               Get-SharePermissions accepts pipeline of computer name(s) 
               .OUTPUTS 
               Produces an array object for each share found. 
               .EXAMPLE 
               C:\PS> .\Get-SharePermissions # Operates against local computer. 
               .EXAMPLE 
               C:\PS> 'computerName' | .\Get-SharePermissions 
               .EXAMPLE 
               C:\PS> Get-Content 'computerlist.txt' | .\Get-SharePermissions | Out-File 'SharePermissions.txt' 
               .EXAMPLE 
               Get-Help .\Get-SharePermissions -Full 
    #> 
    # Written by BigTeddy November 15, 2011 
    # Last updated 9 September 2012  
    # Ver. 2.0  
    # Thanks to Michal Gajda for input with the ACE handling. 
    [cmdletbinding()] 
    param([Parameter(ValueFromPipeline=$True, 
        ValueFromPipelineByPropertyName=$True)]$Computer = '.')  
    $shares = gwmi -Class win32_share -ComputerName $computer | select -ExpandProperty Name  
    foreach ($share in $shares) {  
        $acl = $null  
        Write-Host $share -ForegroundColor Green  
        Write-Host $('-' * $share.Length) -ForegroundColor Green  
        $objShareSec = Get-WMIObject -Class Win32_LogicalShareSecuritySetting -Filter "name='$Share'"  -ComputerName $computer 
        try {  
            $SD = $objShareSec.GetSecurityDescriptor().Descriptor    
            foreach($ace in $SD.DACL){   
                $UserName = $ace.Trustee.Name      
                If ($ace.Trustee.Domain -ne $Null) {$UserName = "$($ace.Trustee.Domain)\$UserName"}    
                If ($ace.Trustee.Name -eq $Null) {$UserName = $ace.Trustee.SIDString }      
                [Array]$ACL += New-Object Security.AccessControl.FileSystemAccessRule($UserName, $ace.AccessMask, $ace.AceType)  
                } #end foreach ACE            
            } # end try  
        catch  
            { Write-Host "Unable to obtain permissions for $share" }  
        $ACL  
        Write-Host $('=' * 50)  
        } # end foreach $share
    This is what the output looks like when ran with 'RemoteServer' | .\Get-SharePermissions.ps1 | Out-File 'sharepermissions.xls'
    FileSystemRights  : Modify, Synchronize
    AccessControlType : Allow
    IdentityReference : Everyone
    IsInherited       : False
    InheritanceFlags  : None
    PropagationFlags  : None

    Actually it is not being written only with Write-Host.  The last line of the loop is this "$ACL"  which ius an array of objects. 
    Here is a version that gets the info more easily and produces flexible objects.  It should be easier to modify into what is needed.
    # Get-ShareSec.ps1
    [cmdletbinding()]
    param(
    [Alias('ComputerName')]
    [Parameter(
    ValueFromPipelineByPropertyName=$True
    )]$Name=$env:COMPUTERNAME
    Process {
    Write-Verbose "Computer=$name"
    $shares =Get-WMiObject Win32_Share -ComputerName $name -Filter 'Type=0' -ea 0
    foreach($share in $shares){
    $sharename=$share.Name
    Write-Verbose "`tShareName=$sharename"
    $ShareSec = Get-WMIObject -Class Win32_LogicalShareSecuritySetting -Filter "name='$ShareName'" -ComputerName $name
    try {
    foreach ($ace in $ShareSec.GetSecurityDescriptor().Descriptor.DACL) {
    $props=[ordered]@{
    ComputerName=$name
    ShareName=$sharename
    TrusteeName=$ace.Trustee.Name
    TrusteeDomain=$ace.Trustee.Domain
    TrusteeSID=$ace.Trustee.SIDString
    New-Object PsObject -Property $props
    catch {
    Write-Warning ('{0} | {1} | {2}' -f $Computer,$sharename, $_)
    Get-Adcomputer -Filter * | .\Get-ShareSec.ps1 -v
    ¯\_(ツ)_/¯

  • Linux Startup script for Forms Services 11g with Weblogic

    Hi,
    Does anybody know where I can find info about the startup script process for Forms Service 11g under linux? I can't find it googling it... I think I have to startup weblogic first... isnt it ? or opmnctl works alone ?
    In 10g we just need to set env vars and then "opmnctl startall" and if we need enterprise manager "emctl start iasconsole" ... what about on 11g?
    Regards
    Ricardo

    You can start directly the WLS_FORMS without starting the Admin and Node manager ..
    I think if you go through this link , you will get more information ..
    Re: Forms 11g - Installation steps for a developer machine

  • Need to write a startup script for TunTap

    Dear community,
    I am using 10.10.1, 13" MBPr Late 2013 and I need to be able to access my Work VPN. From what i have been told, the OS X client can't work and that I have been advised to use Shrew Soft VPN. (We initially tried to get the WatchGuard Firewall to build a Mac .dmg and that didn't work). To get ShrewSoft to work, I have had to follow these steps:
    http://ulaptech.blogspot.co.uk/2012/11/shrew-soft-vpn-client-for-mac-os-x.html
    ·         Install the qt-mac-opensource-4.7.1.dmg file first
    ·         Install the tuntap20111101.tar.gz file second
    ·         Install the shrew soft client.
    But the TunTap download that is above will not work as it is unsigned and Yosemite has now killed off unsigned kexts.I tried turning off the requirement for OS X for signed kexts by using this command:
    sudo nvram boot-args="kext-dev-mode=1"
    Then rebooting, but it didnt work.
    I can get the VPN to work if I open up terminal and enter these two commands:
    sudo kextload /library/extensions/tap.kext
    sudo kextload /library/extensions/tun.kext
    But I have to do this everytime i turn my Mac on.
    Could somebody please help me write those two lines into a startup script? As I really have no idea how to do it.
    Your help and guidance would be appreciated

    Choose Utilities from the Finder’s Go menu, open the AppleScript Editor, and paste in the following:
    set thepassword to text returned of (display dialog "Your administrator password is required." default answer "" with hidden answer)
    do shell script "kextload /Library/Extensions/tap.kext" with administrator privileges password thepassword
    do shell script "kextload /Library/Extensions/tun.kext" with administrator privileges password thepassword
    Save it as an application and set it as a login item.
    (120186)

  • Can we have seperate startup script for each managed server?

    Hi,
    Can we have a seperate startup script (startManagedWebLogic.sh) to start each
    Managed Server? for example startManagedWebLogic.sh for ms1 and startManagedWebLogic.sh
    in ms2 in another directory?
    Any help would be appreciated.
    Thanks
    Siraj

    startManagedWebLogic.sh internally calls startWebLogic.sh with few added parameters, that's all it does. You are free to modify the startup script, the way you want.
    Madan
    >
    Hi,
    Can we have a seperate startup script
    (startManagedWebLogic.sh) to start each
    Managed Server? for example startManagedWebLogic.sh
    for ms1 and startManagedWebLogic.sh
    in ms2 in another directory?
    Any help would be appreciated.
    Thanks
    Siraj

Maybe you are looking for