Skip to content

Commit

Permalink
refactor: improve install script which make easy to install in non-ro…
Browse files Browse the repository at this point in the history
…ot user
  • Loading branch information
moonrailgun committed Nov 19, 2024
1 parent 5ac1b84 commit 53777b3
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/client/components/server/InstallScript.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export const InstallScript: React.FC = React.memo(() => {
const workspaceId = useCurrentWorkspaceId();
const [commandType, setCommandType] = useState('install');
const commandMap: Record<string, string> = {
install: `curl -o- ${window.location.origin}/serverStatus/${workspaceId}/install.sh?url=${window.location.origin} | bash`,
uninstall: `curl -o- ${window.location.origin}/serverStatus/${workspaceId}/install.sh?url=${window.location.origin} | bash -s -- uninstall`,
restart: `curl -o- ${window.location.origin}/serverStatus/${workspaceId}/install.sh?url=${window.location.origin} | bash -s -- reset_conf`,
install: `curl -o- ${window.location.origin}/serverStatus/${workspaceId}/install.sh?url=${window.location.origin} | sudo bash`,
uninstall: `curl -o- ${window.location.origin}/serverStatus/${workspaceId}/install.sh?url=${window.location.origin} | sudo bash -s -- uninstall`,
restart: `curl -o- ${window.location.origin}/serverStatus/${workspaceId}/install.sh?url=${window.location.origin} | sudo bash -s -- reset_conf`,
};
const command = commandMap[commandType] ?? commandMap['install'];

Expand Down
2 changes: 1 addition & 1 deletion website/docs/server-status/server-status-reporter.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ its will auto download reporter and create linux service in your machine. so its

if you wanna uninstall reporter service, you can use this command like:
```bash
curl -o- https://tianji.exmaple.com/serverStatus/xxxxxxxxxxxxxxxxxxx/install.sh?url=https://tianji.example.com | bash -s uninstall
curl -o- https://tianji.exmaple.com/serverStatus/xxxxxxxxxxxxxxxxxxx/install.sh?url=https://tianji.example.com | sudo bash -s uninstall
```

major change is append `-s uninstall` after your install command.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Es wird automatisch den Reporter herunterladen und einen Linux-Dienst auf Ihrem

Wenn Sie den Reporter-Dienst deinstallieren möchten, können Sie diesen Befehl verwenden:
```bash
curl -o- https://tianji.exmaple.com/serverStatus/xxxxxxxxxxxxxxxxxxx/install.sh?url=https://tianji.example.com | bash -s uninstall
curl -o- https://tianji.exmaple.com/serverStatus/xxxxxxxxxxxxxxxxxxx/install.sh?url=https://tianji.example.com | sudo bash -s uninstall
```

Der Hauptunterschied besteht darin, `-s uninstall` nach Ihrem Installationsbefehl anzuhängen.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ il téléchargera automatiquement le rapporteur et créera un service Linux sur

si vous souhaitez désinstaller le service de rapporteur, vous pouvez utiliser cette commande comme :
```bash
curl -o- https://tianji.exmaple.com/serverStatus/xxxxxxxxxxxxxxxxxxx/install.sh?url=https://tianji.example.com | bash -s uninstall
curl -o- https://tianji.exmaple.com/serverStatus/xxxxxxxxxxxxxxxxxxx/install.sh?url=https://tianji.example.com | sudo bash -s uninstall
```

le changement principal consiste à ajouter `-s uninstall` après votre commande d'installation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tianji-reporter の使用方法:

レポーターサービスをアンインストールしたい場合は、次のコマンドを使用できます:
```bash
curl -o- https://tianji.exmaple.com/serverStatus/xxxxxxxxxxxxxxxxxxx/install.sh?url=https://tianji.example.com | bash -s uninstall
curl -o- https://tianji.exmaple.com/serverStatus/xxxxxxxxxxxxxxxxxxx/install.sh?url=https://tianji.example.com | sudo bash -s uninstall
```

主な変更点は、インストールコマンドの後に `-s uninstall` を追加することです。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tianji-reporter 使用方法:

如果您想卸载报告器服务,可以使用以下命令:
```bash
curl -o- https://tianji.exmaple.com/serverStatus/xxxxxxxxxxxxxxxxxxx/install.sh?url=https://tianji.example.com | bash -s uninstall
curl -o- https://tianji.exmaple.com/serverStatus/xxxxxxxxxxxxxxxxxxx/install.sh?url=https://tianji.example.com | sudo bash -s uninstall
```

主要变化是在安装命令后添加 `-s uninstall`
Expand Down

0 comments on commit 53777b3

Please sign in to comment.