2
0

3 コミット bab2646869 ... 707c9d235a

作者 SHA1 メッセージ 日付
  chagood 707c9d235a modified: DomainJoin/UbuntuJoinDomain.sh 1 年間 前
  chagood b362afa12a modified: DomainJoin/UbuntuJoinDomain.sh 1 年間 前
  chagood ae1b91d504 new file: DomainJoin/Static.sh 1 年間 前
2 ファイル変更43 行追加5 行削除
  1. 34 0
      DomainJoin/Static.sh
  2. 9 5
      DomainJoin/UbuntuJoinDomain.sh

+ 34 - 0
DomainJoin/Static.sh

@@ -0,0 +1,34 @@
+#!/bin/bash
+
+set -e
+
+# Write Netplan
+sudo touch /etc/netplan/01-netcfg.yaml
+# Ask for input on network configuration
+read -p "Enter the static IP of the server in CIDR notation: " staticip 
+read -p "Enter the IP of your gateway: " gatewayip
+read -p "Enter the IP of DNS Server 1: " DNS1
+read -p "Enter the IP of DNS Server 2: " DNS2
+read -p "Enter the name of the seach domain: " domain
+echo
+cat > /etc/netplan/01-netcfg.yaml <<EOF
+network:
+  ethernets:
+    enp3s0:
+      addresses:
+      - $staticip
+      routes:
+        - to: default
+          via: $gatewayip
+      nameservers:
+        addresses:
+        - $DNS1
+        - $DNS2
+        search:
+        - $domain
+  version: 2
+EOF
+sudo chmod 600 /etc/netplan/01-netcfg.yaml
+sudo netplan apply
+echo "==========================="
+echo

+ 9 - 5
DomainJoin/UbuntuJoinDomain.sh

@@ -89,6 +89,8 @@ sudo timedatectl set-timezone America/New_York
 # copy file from SCP server to local system
 # sudo scp -r anonymous@ptiwa001:ninja-agent.deb /home/coadmin/
 # curl -o ninja-agent.deb https://app.ninjarmm.com/agent/installer/e99519fc-b76e-4c50-b5ff-ef68db95b032/serverslinuxmainoffice-5.6.7925-installer-x86-64.deb
+
+# Install Ninja RMM Agent
 echo "Installing Ninja..."
 
 # Step 1: Get OAuth token
@@ -105,7 +107,7 @@ access_token=$(echo "$oauth_response" | jq -r '.access_token')
 
 # Step 2: Generate installer URL
 installer_response=$(curl -X 'GET' \
-  'https://app.ninjarmm.com/v2/organization/26/location/45/installer/LINUX_RPM' \
+  'https://app.ninjarmm.com/v2/organization/26/location/45/installer/LINUX_DEB' \
   -H 'accept: application/json' \
   -H "Authorization: Bearer $access_token")
 
@@ -117,17 +119,19 @@ curl -o ninja-agent.deb "$installer_url"
 
 # install Ninja
 sudo dpkg -i ninja-agent.deb
+# End Install Ninja RMM Agent
 
 # copy file from SCP server to local system
 #sudo scp -r anonymous@ptiwa001:falcon-sensor_6.46.0-14306.deb /home/coadmin/
 
 # Install CrowdStrike Falcon
 echo "Installing Falcon Sensor..."
-sudo export FALCON_CLIENT_ID="58f632f6b11c43f48864c9043ec8428d"
-sudo export FALCON_CLIENT_SECRET="8VrQZaLfAHgJNpED0627tyeu9oGbcwWP51mxYk34"
-sudo export FALCON_CID="D0511099B3FF494D8B87F48C4AB90201-56"
-sudo export FALCON_SENSOR_VERSION_DECREMENT="1"
+export FALCON_CLIENT_ID="58f632f6b11c43f48864c9043ec8428d"
+export FALCON_CLIENT_SECRET="8VrQZaLfAHgJNpED0627tyeu9oGbcwWP51mxYk34"
+export FALCON_CID="D0511099B3FF494D8B87F48C4AB90201-56"
+export FALCON_SENSOR_VERSION_DECREMENT="1"
 curl -L https://raw.githubusercontent.com/crowdstrike/falcon-linux-install-bash/main/falcon-linux-deploy.sh | sudo bash
+# End Install CrowdStrike Falcon
 
 # install package using dpkg
 # sudo dpkg -i falcon-sensor_6.46.0-14306.deb