@@ -148,13 +148,13 @@ snap_install() {
148
148
echo " 📥 Downloading ShellHub snap package..."
149
149
150
150
{
151
- sudo snap install shellhub-agent --channel=$AGENT_VERSION
151
+ sudo snap install shellhub --channel=$AGENT_VERSION
152
152
} || { echo " ❌ Failed to download and install ShellHub snap package." ; exit 1; }
153
153
154
154
echo " 🚀 Starting ShellHub snap service..."
155
155
156
156
{
157
- sudo snap start shellhub-agent
157
+ sudo snap start shellhub
158
158
} || { echo " ❌ Failed to start ShellHub snap service." ; exit 1; }
159
159
}
160
160
@@ -182,7 +182,7 @@ standalone_install() {
182
182
} || { rm -rf $TMP_DIR && echo " ❌ Failed to download OCI runtime spec." && exit 1; }
183
183
184
184
{
185
- download https://raw.githubusercontent.com/shellhub-io/shellhub/${AGENT_VERSION} /agent/packaging/shellhub-agent .service $TMP_DIR /shellhub-agent .service
185
+ download https://raw.githubusercontent.com/shellhub-io/shellhub/${AGENT_VERSION} /agent/packaging/shellhub.service $TMP_DIR /shellhub.service
186
186
} || { rm -rf $TMP_DIR && echo " ❌ Failed to download systemd service file." && exit 1; }
187
187
188
188
@@ -201,11 +201,11 @@ standalone_install() {
201
201
sed -i " s,__SERVER_ADDRESS__,$SERVER_ADDRESS ,g" $TMP_DIR /config.json
202
202
sed -i " s,__TENANT_ID__,$TENANT_ID ,g" $TMP_DIR /config.json
203
203
sed -i " s,__ROOT_PATH__,$INSTALL_DIR /rootfs,g" $TMP_DIR /config.json
204
- sed -i " s,__INSTALL_DIR__,$INSTALL_DIR ,g" $TMP_DIR /shellhub-agent .service
204
+ sed -i " s,__INSTALL_DIR__,$INSTALL_DIR ,g" $TMP_DIR /shellhub.service
205
205
206
206
echo " 🚀 Starting ShellHub system service..."
207
207
208
- $SUDO cp $TMP_DIR /shellhub-agent .service /etc/systemd/system/shellhub-agent .service
208
+ $SUDO cp $TMP_DIR /shellhub.service /etc/systemd/system/shellhub.service
209
209
210
210
# NOTE: As we need to check if the service is running to indicate it was installed correctly, we need to copy the
211
211
# values to install directory before enable it, to a correctly check the status.
@@ -214,24 +214,24 @@ standalone_install() {
214
214
215
215
uninstall () {
216
216
echo " Please check the logs with the command:"
217
- echo " journalctl -f -u shellhub-agent "
217
+ echo " journalctl -f -u shellhub"
218
218
echo " "
219
219
echo " ❗ Uninstalling ShellHub agent..."
220
220
$SUDO rm -rf $TMP_DIR
221
221
$SUDO rm -rf $INSTALL_DIR
222
- $SUDO rm /etc/systemd/system/shellhub-agent .service
222
+ $SUDO rm /etc/systemd/system/shellhub.service
223
223
}
224
224
225
- $SUDO systemctl enable --now shellhub-agent || { uninstall && echo " ❌ Failed to enable systemd service." ; exit 1; }
225
+ $SUDO systemctl enable --now shellhub || { uninstall && echo " ❌ Failed to enable systemd service." ; exit 1; }
226
226
227
- trap ' echo "❗ Interrupted. Disabling shellhub-agent ..."; $SUDO systemctl disable --now shellhub-agent ; exit 1' INT
227
+ trap ' echo "❗ Interrupted. Disabling shellhub..."; $SUDO systemctl disable --now shellhub; exit 1' INT
228
228
229
229
echo " 🔍 Checking service status..."
230
230
echo " Please wait for the service to start. This may take a few seconds."
231
231
echo " Press Ctrl+C to cancel the installation."
232
232
233
233
timeout 15s sh -c '
234
- journalctl -f -u shellhub-agent --since "$(systemctl show -p ActiveEnterTimestamp shellhub-agent | cut -d= -f2)" | while read -r line; do
234
+ journalctl -f -u shellhub --since "$(systemctl show -p ActiveEnterTimestamp shellhub | cut -d= -f2)" | while read -r line; do
235
235
if echo "$line" | grep -Eq "Listening for connections"; then
236
236
echo "✅ Success: $line"
237
237
exit 0
@@ -246,13 +246,13 @@ standalone_install() {
246
246
247
247
if [ $exit_code -eq 124 ]; then
248
248
echo " ❌ Timeout: Service took too long to start."
249
- echo " Disabling shellhub-agent service..."
250
- $SUDO systemctl disable --now shellhub-agent
249
+ echo " Disabling shellhub service..."
250
+ $SUDO systemctl disable --now shellhub
251
251
uninstall
252
252
exit 1
253
253
elif [ $exit_code -eq 2 ]; then
254
- echo " Disabling shellhub-agent service..."
255
- $SUDO systemctl disable --now shellhub-agent
254
+ echo " Disabling shellhub service..."
255
+ $SUDO systemctl disable --now shellhub
256
256
uninstall
257
257
exit 1
258
258
fi
0 commit comments