2023-11-05 16:47:06 +00:00
|
|
|
if [ "$EUID" -ne 0 ]; then
|
|
|
|
echo not root
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f /root/.ssh/id_rsa.pub ]; then
|
2023-11-01 13:46:30 +00:00
|
|
|
echo no ssh key, generate: rsa without password
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-11-01 14:01:09 +00:00
|
|
|
|
2023-11-01 13:46:30 +00:00
|
|
|
echo
|
|
|
|
echo Add the following key to your remote sftp:
|
|
|
|
cat /root/.ssh/id_rsa.pub
|
|
|
|
echo
|
|
|
|
echo Press enter to continue
|
|
|
|
read
|
|
|
|
|
2023-11-01 13:46:38 +00:00
|
|
|
apt update
|
|
|
|
apt install -y python3 rclone fuse
|
|
|
|
|
2023-11-05 16:47:06 +00:00
|
|
|
mkdir -p /root/.config/rclone
|
2023-11-01 13:46:30 +00:00
|
|
|
cp -n rclone.conf /root/.config/rclone/rclone.conf
|
|
|
|
cp nman.service /etc/systemd/system/
|
|
|
|
cp nman.timer /etc/systemd/system/
|
2023-11-01 14:10:46 +00:00
|
|
|
cp mnt-files.mount /etc/systemd/system/
|
2023-11-01 13:46:30 +00:00
|
|
|
cp nman /etc/default/
|
|
|
|
cp nman.py /opt/
|
|
|
|
cp nman.sh /opt/
|
|
|
|
chmod +x /opt/nman.sh
|
|
|
|
|
|
|
|
systemctl stop nginx
|
|
|
|
|
|
|
|
rm -rf /etc/nginx
|
|
|
|
mkdir /etc/nginx
|
|
|
|
|
2023-11-05 16:47:06 +00:00
|
|
|
mkdir -p /var/www/html
|
|
|
|
mkdir -p /opt/cache/var-www-html
|
|
|
|
|
|
|
|
systemctl daemon-reload
|
|
|
|
|
2023-11-01 14:10:46 +00:00
|
|
|
systemctl enable --now mnt-files.mount
|
2023-11-05 16:47:06 +00:00
|
|
|
systemctl enable --now var-www-html.mount
|
2023-11-01 13:46:30 +00:00
|
|
|
|
|
|
|
/opt/nman.sh
|
|
|
|
|
2023-11-05 16:47:06 +00:00
|
|
|
systemctl enable --now nman.timer
|
2023-11-01 13:46:30 +00:00
|
|
|
systemctl start nginx
|