Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Have script check for Array being up before executing?

Featured Replies

My array is currently offline as I'm investigating an issue with one of the disks. I noticed that one of my seedbox sync scripts still runs and runs amuck because the array isn't online and it starts creating folders within /mnt/user.

 

This leads me to the question of how do I get a script to check for array being up correctly before it executes?  IOW, if the array is down, I want to abort the script.

Don't know if this is what you want, but hopefully you can derive something from this bash script piece.

 

# Check if array is started
ls /mnt/disk[1-9]* 1>/dev/null 2>/dev/null
if [ $? -ne 0 ]
then
   echo "ERROR:  Array must be started before using this script"
   exit
fi

Don't know if this is what you want, but hopefully you can derive something from this bash script piece.

 

# Check if array is started
ls /mnt/disk[1-9]* 1>/dev/null 2>/dev/null
if [ $? -ne 0 ]
then
   echo "ERROR:  Array must be started before using this script"
   exit
fi

Funny....  I was going to have him parse vars.ini, and never thought about a simple check for directory existing.  Simple solutions are usually the best  ;)
  • Author

Don't know if this is what you want, but hopefully you can derive something from this bash script piece.

 

# Check if array is started
ls /mnt/disk[1-9]* 1>/dev/null 2>/dev/null
if [ $? -ne 0 ]
then
   echo "ERROR:  Array must be started before using this script"
   exit
fi

 

Is checking for the disks enough? Any reason why I couldn't just check for /mnt/user existing?

 

e.g.

 

if [ -d "/mnt/user"]
  <do something>
else
  <do something else>
fi

I can't take any credit, I took it from others scripts!

 

Is checking for the disks enough? Any reason why I couldn't just check for /mnt/user existing?

 

Checking for the disks is enough to know if the array is started.  Checking for /mnt/user is also fine, *if* you know the user has User Shares enabled.  If they don't, there won't be a /mnt/user, ever.  I don't have it in my system.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.