-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add FreeBSD compatibility and FreeBSD services support #18
base: master
Are you sure you want to change the base?
Conversation
nice work |
tracker-add-auto.sh
Outdated
echo "URL for ${base_url}" | ||
echo "Adding trackers for $torrent_name..." | ||
for tracker in $(cat $trackerslist) ; do | ||
echo -n "${tracker}..." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo -n
doesn't work on bin/sh, maybe printf '%s\n'
can fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very strange. Are you sure this code doesn't work?
Test 1:
user:~$ sh
$ uname -sv
Linux #49-Ubuntu SMP Fri Feb 5 03:01:28 UTC 2021
$ echo -n "test..."
test...$
Test 2:
root@server:~ # sh
# uname -sv
FreeBSD FreeBSD 12.2-RELEASE-p3 7851f4a452d(HEAD) TRUENAS
# echo -n "test..."
test...#
tracker-add-auto.sh
Outdated
dater="$(date "+%Y-%m-%d %H:%M")" | ||
|
||
if [ ! -f "/tmp/TTAA.$id.lock" ]; then | ||
if [ "$add_date_t" = "$dater" -o "$add_date_t" = "$dateo" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
regress changes
should be if [[ "( "$(add_date_t)" == "$(dater)" || "$(add_date_t)" == "$(dateo)" )" ]]; then
or something like that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no built-in command [[
in sh
. There is a command [
, which has a slightly different syntax. I just translated the logic of the command [[
into the syntax of the command [
.
What you wrote is exactly the condition that is specified.
tracker-add-auto.sh
Outdated
ids="$(${trans} --list | grep -vE 'Seeding|Stopped|Finished|[[:space:]]100%[[:space:]]' | grep '^ ' | awk '{ print $1 }' | grep -vE 'ID')" | ||
for id in $ids ; do | ||
add_date="$(${trans} --torrent "$id" --info| grep '^ Date added: ' |cut -c 21-)" | ||
if [ $(uname) = "FreeBSD" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"$(uname)"
just in case, prevent word splitting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
# Conflicts: # tracker-add-auto.sh
PR updated |
No description provided.