mirror of
https://github.com/bigbeartechworld/big-bear-scripts.git
synced 2026-07-30 17:16:15 -04:00
Add change casaos web ui port
This commit is contained in:
5
change-casaos-web-ui-port/README.md
Normal file
5
change-casaos-web-ui-port/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Run command
|
||||
|
||||
```bash
|
||||
bash -c "$(wget -qLO - https://raw.githubusercontent.com/bigbeartechworld/big-bear-scripts/master/change-casaos-web-ui-port/run.sh)"
|
||||
```
|
||||
21
change-casaos-web-ui-port/run.sh
Normal file
21
change-casaos-web-ui-port/run.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ask the user for the new port number
|
||||
read -p "Enter the new port number for CasaOS: " new_port
|
||||
|
||||
# Check if the input is a valid number
|
||||
if ! [[ "$new_port" =~ ^[0-9]+$ ]]; then
|
||||
echo "Error: Please enter a valid port number."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Backup the original configuration file
|
||||
cp /etc/casaos/gateway.conf /etc/casaos/gateway.conf.bak
|
||||
|
||||
# Change the port number in the configuration file
|
||||
sed -i "s/^port=[0-9]\+/port=$new_port/" /etc/casaos/gateway.conf
|
||||
|
||||
# Restart the CasaOS Gateway service
|
||||
systemctl restart casaos-gateway.service
|
||||
|
||||
echo "Port changed and CasaOS Gateway service restarted successfully."
|
||||
Reference in New Issue
Block a user