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.

Script, Help please with syntax.

Featured Replies

i'm looking to write a prequeue script for sabnzbd and i'm a little unsure of how to do something as i'm fairly new to linux in general.

 

i thought i'd ask here as well as on the sab forum as there may be something peculiar to unraid that i should be aware of.

 

I'm looking to have movies that are 2012 and later assigned a higher priority in my sab queue and looking to do it automatically.

 

the bit i need help with is how to do the

 

if (name of movie contains 2012 or 2013) bit of the script. any linux gurus here that can help ?

never used their prescripts but take a look here:

http://wiki.sabnzbd.org/user-pre-queue-script

 

looks like it passes 11 parameters as variable. these variables should be assigned numerically as such: $1, $2, $3, etc. it doesnt look like any of the parameters passed to the script show the year of the movie. so what i would do is this:

first, check to make sure it is a movie by the category. then if it if, use a regex to find the date based on the name of the file. if you arent familiar with regex, you can do a little digging. im sure it would be easy enough to find the regular expression you want instead of making one yourself since a number of programs like sickbeard, xbmc, and sabnzbd all use a regex specific to scene release naming. then if the date is equal of grater to 2012, change the category.

  • Author

got it working with some heavy googling and trial and error.

 

#!/usr/bin/env bash

 

 

curyear=`date +%Y`

lastyear=$((`date +%Y` -1))

testyear=($lastyear,$curyear)

 

 

if [[ $1 == *$testyear* ]]

then

case $3 in

      *movie*)

        priority="1"

        ;;

*)

        priority="$5"

        ;;

  esac

else

  priority="$5"

fi

 

 

 

echo "1"   

echo $1   

echo $2   

echo $3   

echo $4

echo "$priority"

echo $6

echo $7

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.