mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-01-30 09:48:11 +01:00
Compare commits
3 Commits
96b997e8cf
...
3ba7e6da11
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ba7e6da11 | ||
|
|
e15f5ee6df | ||
|
|
2734857902 |
@ -1,10 +1,21 @@
|
||||
#!/bin/dash
|
||||
|
||||
sleep 16
|
||||
while ! ping -c 1 9.9.9.9 > /dev/null 2>&1; do sleep 0.5; done
|
||||
|
||||
DATA_DIR="$HOME/.cache/youtube_channels"
|
||||
CHANNEL_LIST="$HOME/.local/share/channels.txt"
|
||||
mkdir -p "$DATA_DIR"
|
||||
mkdir -p "$DATA_DIR" && touch "$CHANNEL_LIST"
|
||||
|
||||
error_handling() {
|
||||
[ -s "$CHANNEL_LIST" ] || {
|
||||
notify-send "You don't have any channels in 'channels.txt'."
|
||||
exit 1
|
||||
}
|
||||
grep -q "^.*=https://www.youtube.com/@[[:alnum:]]*/videos$" "$CHANNEL_LIST" || {
|
||||
notify-send "'channels.txt' formatting is wrong."
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
compare_data() {
|
||||
local channel_name="$1"
|
||||
@ -47,4 +58,5 @@ update_all_channels() {
|
||||
done < "$CHANNEL_LIST"
|
||||
}
|
||||
|
||||
error_handling
|
||||
update_all_channels
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user