From 2597c03d1555e00dec59830b7de75e7090208e05 Mon Sep 17 00:00:00 2001 From: Slack Coder Date: Wed, 2 Oct 2024 16:49:36 -0500 Subject: config: Use TOML TOML is simple for users, and it is used in notably projects like rustlang. It also provides comments! --- contrib/slackbuild/config.json | 6 ------ contrib/slackbuild/doinst.sh | 2 +- contrib/slackbuild/mirror.SlackBuild | 2 +- contrib/slackbuild/mirror.toml | 10 ++++++++++ contrib/slackbuild/rc.mirror | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) delete mode 100644 contrib/slackbuild/config.json create mode 100644 contrib/slackbuild/mirror.toml (limited to 'contrib') diff --git a/contrib/slackbuild/config.json b/contrib/slackbuild/config.json deleted file mode 100644 index f9fe2e9..0000000 --- a/contrib/slackbuild/config.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "min-interval": "1h", - "max-interval": "24h", - "mirrors": [ - ] -} diff --git a/contrib/slackbuild/doinst.sh b/contrib/slackbuild/doinst.sh index 7a11ce4..60cac25 100644 --- a/contrib/slackbuild/doinst.sh +++ b/contrib/slackbuild/doinst.sh @@ -40,4 +40,4 @@ fi chown mirror:mirror /var/log/mirror preserve_perms etc/rc.d/rc.mirror.new -preserve_perms etc/mirror/config.json.new +preserve_perms etc/mirror/mirror.toml.new diff --git a/contrib/slackbuild/mirror.SlackBuild b/contrib/slackbuild/mirror.SlackBuild index eccbc1a..66d6234 100644 --- a/contrib/slackbuild/mirror.SlackBuild +++ b/contrib/slackbuild/mirror.SlackBuild @@ -63,7 +63,7 @@ cat "$CWD/doinst.sh" > "$PKG/install/doinst.sh" mkdir -p "$PKG/etc/rc.d" cat "$CWD/rc.mirror" > "$PKG/etc/rc.d/rc.mirror.new" mkdir -p $PKG/etc/mirror -cat "$CWD/config.json" > "$PKG/etc/mirror/config.json.new" +cat "$CWD/mirror.toml" > "$PKG/etc/mirror/mirror.toml.new" mkdir -p "$PKG/var/log/mirror" cd "$PKG" diff --git a/contrib/slackbuild/mirror.toml b/contrib/slackbuild/mirror.toml new file mode 100644 index 0000000..d3522e6 --- /dev/null +++ b/contrib/slackbuild/mirror.toml @@ -0,0 +1,10 @@ +[global] +min-interval = "15s" +max-interval = "1m" + +[[mirrors]] +method = "git" +from = "https://github.com/ytdl-org/youtube-dl" +to = "/home/cypher/Desktop/youtube-dl" +description = "Command-line program to download videos from YouTube.com and other video sites" + diff --git a/contrib/slackbuild/rc.mirror b/contrib/slackbuild/rc.mirror index 81acb9b..df3c72f 100644 --- a/contrib/slackbuild/rc.mirror +++ b/contrib/slackbuild/rc.mirror @@ -20,7 +20,7 @@ start() { --user=mirror \ --pidfiles=/run/mirror \ --output=/var/log/mirror/mirror.log \ - -- mirror -config /etc/mirror/config.json + -- mirror -config /etc/mirror/mirror.toml } stop() { -- cgit v1.2.3