Skip to content

Commit bf65348

Browse files
committed
fix(install): rename references to shellhub-agent aliast to shellhub
1 parent 5c90496 commit bf65348

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

install.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,13 @@ snap_install() {
148148
echo "📥 Downloading ShellHub snap package..."
149149

150150
{
151-
sudo snap install shellhub-agent --channel=$AGENT_VERSION
151+
sudo snap install shellhub --channel=$AGENT_VERSION
152152
} || { echo "❌ Failed to download and install ShellHub snap package."; exit 1; }
153153

154154
echo "🚀 Starting ShellHub snap service..."
155155

156156
{
157-
sudo snap start shellhub-agent
157+
sudo snap start shellhub
158158
} || { echo "❌ Failed to start ShellHub snap service."; exit 1; }
159159
}
160160

@@ -182,7 +182,7 @@ standalone_install() {
182182
} || { rm -rf $TMP_DIR && echo "❌ Failed to download OCI runtime spec." && exit 1; }
183183

184184
{
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
186186
} || { rm -rf $TMP_DIR && echo "❌ Failed to download systemd service file." && exit 1; }
187187

188188

@@ -201,11 +201,11 @@ standalone_install() {
201201
sed -i "s,__SERVER_ADDRESS__,$SERVER_ADDRESS,g" $TMP_DIR/config.json
202202
sed -i "s,__TENANT_ID__,$TENANT_ID,g" $TMP_DIR/config.json
203203
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
205205

206206
echo "🚀 Starting ShellHub system service..."
207207

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
209209

210210
# NOTE: As we need to check if the service is running to indicate it was installed correctly, we need to copy the
211211
# values to install directory before enable it, to a correctly check the status.
@@ -214,24 +214,24 @@ standalone_install() {
214214

215215
uninstall() {
216216
echo "Please check the logs with the command:"
217-
echo "journalctl -f -u shellhub-agent"
217+
echo "journalctl -f -u shellhub"
218218
echo ""
219219
echo "❗ Uninstalling ShellHub agent..."
220220
$SUDO rm -rf $TMP_DIR
221221
$SUDO rm -rf $INSTALL_DIR
222-
$SUDO rm /etc/systemd/system/shellhub-agent.service
222+
$SUDO rm /etc/systemd/system/shellhub.service
223223
}
224224

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; }
226226

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
228228

229229
echo "🔍 Checking service status..."
230230
echo "Please wait for the service to start. This may take a few seconds."
231231
echo "Press Ctrl+C to cancel the installation."
232232

233233
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
235235
if echo "$line" | grep -Eq "Listening for connections"; then
236236
echo "✅ Success: $line"
237237
exit 0
@@ -246,13 +246,13 @@ standalone_install() {
246246

247247
if [ $exit_code -eq 124 ]; then
248248
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
251251
uninstall
252252
exit 1
253253
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
256256
uninstall
257257
exit 1
258258
fi

0 commit comments

Comments
 (0)