|
|
|
@ -316,47 +316,57 @@ step7(){
|
|
|
|
|
# (1) Create sats-boot service #
|
|
|
|
|
echo " (.) Create sats-boot service";
|
|
|
|
|
echo " - /lib/systemd/system";
|
|
|
|
|
sudo cp ./utility/sats-boot.service /mnt/lib/systemd/system/sats-boot.service;
|
|
|
|
|
sudo cp ./utility/sats-boot.service /mnt/lib/systemd/system/sats-boot.service;
|
|
|
|
|
|
|
|
|
|
# (2) Create sats-install service #
|
|
|
|
|
echo " (.) Create sats-install service";
|
|
|
|
|
echo " - /lib/systemd/system";
|
|
|
|
|
sudo cp ./utility/sats-install.service /mnt/lib/systemd/system/sats-install.service;
|
|
|
|
|
sudo cp ./utility/sats-install.service /mnt/lib/systemd/system/sats-install.service;
|
|
|
|
|
|
|
|
|
|
# (3) Create sats-update service #
|
|
|
|
|
echo " (.) Create sats-update service";
|
|
|
|
|
echo " - /lib/systemd/system";
|
|
|
|
|
sudo cp ./utility/sats-update.service /mnt/lib/systemd/system/sats-update.service;
|
|
|
|
|
sudo cp ./utility/sats-update.service /mnt/lib/systemd/system/sats-update.service;
|
|
|
|
|
|
|
|
|
|
# (4) Create sats-loop service #
|
|
|
|
|
echo " (.) Create sats-loop service";
|
|
|
|
|
echo " - /lib/systemd/system";
|
|
|
|
|
sudo cp ./utility/sats-loop.service /mnt/lib/systemd/system/sats-loop.service;
|
|
|
|
|
sudo cp ./utility/sats-loop.service /mnt/lib/systemd/system/sats-loop.service;
|
|
|
|
|
|
|
|
|
|
# (5) Create sats-sync target #
|
|
|
|
|
echo " (.) Create sats-sync target";
|
|
|
|
|
echo " (.) Create sats-sync target (service)";
|
|
|
|
|
echo " - /lib/systemd/system";
|
|
|
|
|
sudo cp ./utility/sats-sync.target /mnt/lib/systemd/system/sats-sync.target
|
|
|
|
|
sudo cp ./utility/sats-sync.service /mnt/lib/systemd/system/sats-sync.service;
|
|
|
|
|
|
|
|
|
|
# (6) Create sats-sync path #
|
|
|
|
|
# (6) Create sats-sync-stop service #
|
|
|
|
|
echo " (.) Create sats-sync-stop service";
|
|
|
|
|
echo " - /lib/systemd/system";
|
|
|
|
|
sudo cp ./utility/sats-sync-stop.service /mnt/lib/systemd/system/sats-sync-stop.service;
|
|
|
|
|
|
|
|
|
|
# (7) Create sats-sync path #
|
|
|
|
|
echo " (.) Create sats-sync path";
|
|
|
|
|
echo " - /lib/systemd/system";
|
|
|
|
|
sudo cp ./utility/sats-sync.path /mnt/lib/systemd/system/sats-sync.path;
|
|
|
|
|
sudo cp ./utility/sats-sync.path /mnt/lib/systemd/system/sats-sync.path;
|
|
|
|
|
|
|
|
|
|
# (7) Create sats-update timer #
|
|
|
|
|
# (8) Create sats-sync-stop path #
|
|
|
|
|
echo " (.) Create sats-sync-stop path";
|
|
|
|
|
echo " - /lib/systemd/system";
|
|
|
|
|
sudo cp ./utility/sats-sync-stop.path /mnt/lib/systemd/system/sats-sync-stop.path;
|
|
|
|
|
|
|
|
|
|
# (9) Create sats-update timer #
|
|
|
|
|
echo " (.) Create sats-update timer";
|
|
|
|
|
echo " - /lib/systemd/system";
|
|
|
|
|
sudo cp ./utility/sats-update.timer /mnt/lib/systemd/system/sats-update.timer;
|
|
|
|
|
sudo cp ./utility/sats-update.timer /mnt/lib/systemd/system/sats-update.timer;
|
|
|
|
|
|
|
|
|
|
# (8) Create sats-dwc@ service #
|
|
|
|
|
# (10) Create sats-dwc@ service #
|
|
|
|
|
echo " (.) Create sats-dwc@ service";
|
|
|
|
|
echo " - /lib/systemd/system";
|
|
|
|
|
sudo cp ./utility/sats-dwc@.service /mnt/lib/systemd/system/sats-dwc@.service;
|
|
|
|
|
sudo cp ./utility/sats-dwc@.service /mnt/lib/systemd/system/sats-dwc@.service;
|
|
|
|
|
|
|
|
|
|
# (9) Create firewall@ service #
|
|
|
|
|
# (11) Create firewall@ service #
|
|
|
|
|
echo " (.) Create firewall@ service";
|
|
|
|
|
echo " - /lib/systemd/system";
|
|
|
|
|
sudo cp ./utility/firewall@.service /mnt/lib/systemd/system/firewall@.service;
|
|
|
|
|
sudo cp ./utility/firewall@.service /mnt/lib/systemd/system/firewall@.service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# (3) Install services
|
|
|
|
@ -366,30 +376,34 @@ step7(){
|
|
|
|
|
|
|
|
|
|
# (2) Enable sats-loop at startup #
|
|
|
|
|
echo " (.) Emulate \`systemctl enable sats-loop.service\`";
|
|
|
|
|
sudo ln -fs /lib/systemd/system/sats-loop.service /mnt/etc/systemd/system/multi-user.target.wants/sats-loop.service;
|
|
|
|
|
sudo ln -fs /lib/systemd/system/sats-loop.service /mnt/etc/systemd/system/multi-user.target.wants/sats-loop.service;
|
|
|
|
|
|
|
|
|
|
# (3) Enable sats-sync path at startup #
|
|
|
|
|
echo " (.) Emulate \`systemctl enable sats-sync.path\`";
|
|
|
|
|
sudo ln -fs /lib/systemd/system/sats-sync.path /mnt/etc/systemd/system/multi-user.target.wants/sats-sync.path;
|
|
|
|
|
|
|
|
|
|
# (4) Enable sats-update timer at startup #
|
|
|
|
|
# (3) Enable sats-update timer at startup #
|
|
|
|
|
echo " (.) Emulate \`systemctl enable sats-update.timer\`";
|
|
|
|
|
sudo ln -fs /lib/systemd/system/sats-update.timer /mnt/etc/systemd/system/multi-user.target.wants/sats-update.timer;
|
|
|
|
|
sudo ln -fs /lib/systemd/system/sats-update.timer /mnt/etc/systemd/system/multi-user.target.wants/sats-update.timer;
|
|
|
|
|
|
|
|
|
|
# (5) Enable sats-dwc@wlan0 at startup #
|
|
|
|
|
# (4) Enable sats-sync path at startup #
|
|
|
|
|
echo " (.) Emulate \`systemctl enable sats-sync.path\`";
|
|
|
|
|
sudo ln -fs /lib/systemd/system/sats-sync.path /mnt/etc/systemd/system/multi-user.target.wants/sats-sync.path;
|
|
|
|
|
|
|
|
|
|
# (5) Enable sats-sync-stop path at startup #
|
|
|
|
|
echo " (.) Emulate \`systemctl enable sats-sync-stop.path\`";
|
|
|
|
|
sudo ln -fs /lib/systemd/system/sats-sync-stop.path /mnt/etc/systemd/system/multi-user.target.wants/sats-sync-stop.path;
|
|
|
|
|
|
|
|
|
|
# (6) Enable sats-dwc@wlan0 at startup #
|
|
|
|
|
echo " (.) Emulate \`systemctl enable sats-dwc@wlan0.service\`";
|
|
|
|
|
sudo ln -fs /lib/systemd/system/sats-dwc@.service /mnt/etc/systemd/system/multi-user.target.wants/sats-dwc@wlan0.service;
|
|
|
|
|
sudo ln -fs /lib/systemd/system/sats-dwc@.service /mnt/etc/systemd/system/multi-user.target.wants/sats-dwc@wlan0.service;
|
|
|
|
|
|
|
|
|
|
# (6) Enable firewall@default at startup #
|
|
|
|
|
# (7) Enable firewall@default at startup #
|
|
|
|
|
echo " (.) Emulate \`systemctl enable firewall@default.service\`";
|
|
|
|
|
sudo ln -fs /lib/systemd/system/firewall@.service /mnt/etc/systemd/system/multi-user.target.wants/firewall@default.service;
|
|
|
|
|
sudo ln -fs /lib/systemd/system/firewall@.service /mnt/etc/systemd/system/multi-user.target.wants/firewall@default.service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# (4) Create target scripts
|
|
|
|
|
#--------------------------------------------------------#
|
|
|
|
|
# (1) Create sats-boot script #
|
|
|
|
|
echo " (.) Create sats-boot script";
|
|
|
|
|
sudo cp ./utility/sats-boot /mnt/service/sats-boot;
|
|
|
|
|
sudo cp ./utility/sats-boot /mnt/service/sats-boot;
|
|
|
|
|
|
|
|
|
|
# (2) Create sats-install script #
|
|
|
|
|
echo " (.) Create sats-install script";
|
|
|
|
@ -397,20 +411,24 @@ step7(){
|
|
|
|
|
|
|
|
|
|
# (3) Create sats-update script #
|
|
|
|
|
echo " (.) Create sats-update script";
|
|
|
|
|
cat ./utility/sats-update | sudo tee /mnt/service/sats-update > /dev/null;
|
|
|
|
|
cat ./utility/sats-update | sudo tee /mnt/service/sats-update > /dev/null;
|
|
|
|
|
|
|
|
|
|
# (4) Create sats-loop script #
|
|
|
|
|
echo " (.) Create sats-loop script";
|
|
|
|
|
cat ./utility/sats-loop | sudo tee /mnt/service/sats-loop > /dev/null;
|
|
|
|
|
cat ./utility/sats-loop | sudo tee /mnt/service/sats-loop > /dev/null;
|
|
|
|
|
|
|
|
|
|
# (5) Create sats-dwc@wlan0 script #
|
|
|
|
|
# (5) Create sats-sync-stop script #
|
|
|
|
|
echo " (.) Create sats-sync-stop script";
|
|
|
|
|
cat ./utility/sats-sync-stop | sudo tee /mnt/service/sats-sync-stop > /dev/null;
|
|
|
|
|
|
|
|
|
|
# (6) Create sats-dwc@wlan0 script #
|
|
|
|
|
echo " (.) Create sats-dwc@wlan0 script";
|
|
|
|
|
cat ./utility/wlan0.dwc | sed "s/\*\*\*SALT\*\*\*/$WIFI_SALT/" | sed "s/\*\*\*PEPPER\*\*\*/$WIFI_PEPPER/" | sudo tee /mnt/etc/wpa_supplicant/wlan0.dwc > /dev/null;
|
|
|
|
|
cat ./utility/wlan0.dwc | sed "s/\*\*\*SALT\*\*\*/$WIFI_SALT/" | sed "s/\*\*\*PEPPER\*\*\*/$WIFI_PEPPER/" | sudo tee /mnt/etc/wpa_supplicant/wlan0.dwc > /dev/null;
|
|
|
|
|
|
|
|
|
|
# (6) Create firewall@default script #
|
|
|
|
|
# (7) Create firewall@default script #
|
|
|
|
|
echo " (.) Create firewall@default script";
|
|
|
|
|
sudo mkdir -p /mnt/opt/firewall;
|
|
|
|
|
cat ./utility/default.fw | sudo tee /mnt/opt/firewall/default.fw > /dev/null;
|
|
|
|
|
cat ./utility/default.fw | sudo tee /mnt/opt/firewall/default.fw > /dev/null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# (5) Set up permissions
|
|
|
|
@ -425,7 +443,7 @@ step7(){
|
|
|
|
|
# (2) target dir #
|
|
|
|
|
echo " - /target (sats:pi 750)";
|
|
|
|
|
sudo chown -R 666:1000 /mnt/target;
|
|
|
|
|
sudo chmod -R 750 /mnt/target;
|
|
|
|
|
sudo chmod -R 755 /mnt/target;
|
|
|
|
|
|
|
|
|
|
echo "<<< done";
|
|
|
|
|
|
|
|
|
@ -553,6 +571,7 @@ echo "(6) Manage ssh keys";
|
|
|
|
|
echo "(7) Set up systemd background";
|
|
|
|
|
echo "(8) Set up WiFi config";
|
|
|
|
|
echo "(9) Set up SATS daemon";
|
|
|
|
|
echo "(10) Proper finishing";
|
|
|
|
|
read -p "step: " step;
|
|
|
|
|
|
|
|
|
|
case $step in
|
|
|
|
@ -565,5 +584,6 @@ case $step in
|
|
|
|
|
"7") step7;;
|
|
|
|
|
"8") step8;;
|
|
|
|
|
"9") step9;;
|
|
|
|
|
"10") step10;;
|
|
|
|
|
*) echo "wrong step"; exit;;
|
|
|
|
|
esac;
|
|
|
|
|