File tree Expand file tree Collapse file tree 3 files changed +33
-23
lines changed
Expand file tree Collapse file tree 3 files changed +33
-23
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash -e
2+
3+ if [ " ${EUID} " -ne 0 ]; then
4+ echo " This script should be run as root."
5+ exit 1
6+ fi
7+
8+ if command -v mosh & > /dev/null; then
9+ ufw allow mosh comment " Mosh"
10+ fi
11+
12+ ufw allow ssh comment " SSH"
13+
14+ if command -v syncthing & > /dev/null; then
15+ ufw allow 22000/tcp comment " Syncthing"
16+ ufw allow 21027/udp comment " Syncthing Discovery"
17+
18+ while true ; do
19+ read -p " Do you want to allow Syncthing remote GUI access? (y/n) " yn
20+
21+ case $yn in
22+ [yY] ) echo " Enabling remote GUI access"
23+ ufw allow 8384 comment " Syncthing GUI"
24+ break ;;
25+ [nN] ) echo " Skipping remote GUI access"
26+ exit ;;
27+ * ) echo " Invalid response" ;;
28+ esac
29+ done
30+ fi
31+
32+ ufw enable
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ systemctl restart ssh
1616
1717if command -v & > /dev/null; then
1818 echo " Creating UFW firewall rule and enabling UFW."
19- ufw allow ssh comment SSH
19+ ufw allow ssh comment " SSH"
2020 ufw enable
2121else
2222 echo " UFW was not found."
You can’t perform that action at this time.
0 commit comments