Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Toyo authored May 7, 2017
1 parent dcabb77 commit 74bc63a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions other/aria2_centos
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# chkconfig: 2345 90 10
# description: aria2 is a lightweight multi-protocol & multi-source command-line download utility.

Expand All @@ -14,6 +16,8 @@

NAME="Aria2"
NAME_BIN="aria2c"
CONFIG="/root/.aria2/aria2.conf"
LOG="/root/.aria2/aria2.log"

Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Red_background_prefix="\033[41;37m" && Font_color_suffix="\033[0m"
Info="${Green_font_prefix}[信息]${Font_color_suffix}"
Expand All @@ -33,7 +37,7 @@ do_start(){
if [[ $? -eq 0 ]]; then
echo -e "${Info} $NAME (PID ${PID}) 正在运行..." && exit 0
else
nohup aria2c -c "${HOME}/.aria2" > "${HOME}/.aria2/aria2.log" 2>&1 &
nohup aria2c -c "${CONFIG}" > "${LOG}" 2>&1 &
sleep 2s
check_running
if [[ $? -eq 0 ]]; then
Expand Down
8 changes: 6 additions & 2 deletions other/aria2_debian
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

### BEGIN INIT INFO
# Provides: aria2 is a lightweight multi-protocol & multi-source command-line download utility.
Expand All @@ -12,6 +14,8 @@

NAME="Aria2"
NAME_BIN="aria2c"
CONFIG="/root/.aria2/aria2.conf"
LOG="/root/.aria2/aria2.log"

Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Red_background_prefix="\033[41;37m" && Font_color_suffix="\033[0m"
Info="${Green_font_prefix}[信息]${Font_color_suffix}"
Expand All @@ -31,7 +35,7 @@ do_start(){
if [[ $? -eq 0 ]]; then
echo -e "${Info} $NAME (PID ${PID}) 正在运行..." && exit 0
else
nohup aria2c -c "${HOME}/.aria2" > "${HOME}/.aria2/aria2.log" 2>&1 &
nohup aria2c -c "${CONFIG}" > "${LOG}" 2>&1 &
sleep 2s
check_running
if [[ $? -eq 0 ]]; then
Expand Down

0 comments on commit 74bc63a

Please sign in to comment.