test
This commit is contained in:
parent
85218921c0
commit
c75a62db4c
30
plex-scan.sh
Normal file
30
plex-scan.sh
Normal file
@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
update_from_cli() {
|
||||
# ChuckPa already wrote a great function for getting host info
|
||||
source ./HostConfig.sh
|
||||
echo "Getting Host Information"
|
||||
HostConfig
|
||||
plex_scanner_location="$PKGDIR/Plex Media Scanner"
|
||||
|
||||
echo "Getting Plex Library list"
|
||||
echo $("$plex_scanner_location" --list)
|
||||
|
||||
exit
|
||||
}
|
||||
|
||||
update_from_api() {
|
||||
# get plex token
|
||||
source ./plex-token.sh
|
||||
|
||||
echo "Scanning All Libraries"
|
||||
plex_api_url="http://127.0.0.1:32400/library/sections/all/refresh\?X-Plex-Token=${LOCAL_PLEX_TOKEN}"
|
||||
curl -X PUT $plex_api_url
|
||||
|
||||
}
|
||||
|
||||
case "$2" in
|
||||
cli) update_from_cli;;
|
||||
""|api) update_from_api;;
|
||||
*) echo "'$2' is not a valid plex-tools freshen command";;
|
||||
esac
|
||||
Loading…
Reference in New Issue
Block a user