Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrohy committed Mar 3, 2020
1 parent 900e4c2 commit 2c80bde
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
7 changes: 5 additions & 2 deletions asset/docker_tip.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
docker 运行
docker run -it -d --name trojan --net=host --restart=always --privileged -v /var/run/docker.sock:/var/run/docker.sock -v `which docker`:`which docker` jrohy/trojan
mysql 运行
docker run --name trojan-mysql --restart=always -p 3306:3306 -v /home/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=trojan -e MYSQL_ROOT_HOST=% -e MYSQL_DATABASE=trojan -d mysql/mysql-server:5.7

trojan 运行
docker run -it -d --name trojan --net=host --restart=always --privileged jrohy/trojan init

2 changes: 1 addition & 1 deletion asset/trojan-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ else
echo Skipping installing $NAME server config...
fi

if [[ ! -e "/.dockerenv" && -d "$SYSTEMDPREFIX" ]]; then
if [[ -d "$SYSTEMDPREFIX" ]]; then
echo Installing $NAME systemd service to $SYSTEMDPATH...
if ! [[ -f "$SYSTEMDPATH" ]] || prompt "The systemd service already exists in $SYSTEMDPATH, overwrite?"; then
cat > "$SYSTEMDPATH" << EOF
Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/spf13/cobra"
)

const VERSION = "v1.3.0"
const VERSION = "v1.3.1"

// versionCmd represents the version command
var versionCmd = &cobra.Command{
Expand Down
6 changes: 2 additions & 4 deletions trojan/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ func InstallTrojan() {
fmt.Println(err)
}
util.ExecCommand(data)
if !util.IsExists("/.dockerenv") {
util.ExecCommand("systemctl restart trojan")
util.ExecCommand("systemctl enable trojan")
}
util.ExecCommand("systemctl restart trojan")
util.ExecCommand("systemctl enable trojan")
util.OpenPort(443)
fmt.Println()
}
Expand Down

0 comments on commit 2c80bde

Please sign in to comment.