This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/main by this push:
     new 39126a43392 Standardize and auto add license headers for Shell files 
with pre-commit (#12070)
39126a43392 is described below

commit 39126a43392ce5aa5a5ce2332de8ec8eebd008a0
Author: John Bampton <[email protected]>
AuthorDate: Fri Nov 14 23:23:41 2025 +1000

    Standardize and auto add license headers for Shell files with pre-commit 
(#12070)
    
    * Add shebang to shell scripts
---
 .pre-commit-config.yaml                            | 10 +++++++
 plugins/hypervisors/hyperv/buildagent.sh           | 30 ++++++++++---------
 .../ovm3/src/test/resources/scripts/socat.sh       | 30 ++++++++++---------
 .../ovm3/src/test/resources/scripts/tail.sh        | 30 ++++++++++---------
 scripts/vm/hypervisor/kvm/nasbackup.sh             | 33 +++++++++++----------
 scripts/vm/hypervisor/kvm/nsrkvmbackup.sh          | 33 +++++++++++----------
 scripts/vm/hypervisor/kvm/nsrkvmrestore.sh         | 33 +++++++++++----------
 systemvm/debian/opt/cloud/bin/baremetal_snat.sh    | 28 +++++++++---------
 systemvm/debian/opt/cloud/bin/dnsmasq.sh           |  2 ++
 systemvm/debian/opt/cloud/bin/prepare_pxe.sh       |  5 ++--
 tools/devcloud4/common/configure-network.sh        | 34 +++++++++++-----------
 11 files changed, 144 insertions(+), 124 deletions(-)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index d324c958bb1..107bd8b94cd 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -62,6 +62,16 @@ repos:
           - .github/workflows/license-templates/LICENSE.txt
           - --fuzzy-match-generates-todo
         exclude: 
^(CHANGES|ISSUE_TEMPLATE|PULL_REQUEST_TEMPLATE)\.md$|^ui/docs/(full|smoke)-test-plan\.template\.md$
+      - id: insert-license
+        name: add license for all Shell files
+        description: automatically adds a licence header to all Shell files 
that don't have a license header
+        files: \.sh$
+        args:
+          - --comment-style
+          - '|#|'
+          - --license-filepath
+          - .github/workflows/license-templates/LICENSE.txt
+          - --fuzzy-match-generates-todo
       - id: insert-license
         name: add license for all SQL files
         files: \.sql$
diff --git a/plugins/hypervisors/hyperv/buildagent.sh 
b/plugins/hypervisors/hyperv/buildagent.sh
index e5bff6e3153..536ba437ffc 100755
--- a/plugins/hypervisors/hyperv/buildagent.sh
+++ b/plugins/hypervisors/hyperv/buildagent.sh
@@ -1,20 +1,22 @@
 #!/bin/bash
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements. See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership. The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License. You may obtain a copy of the License at
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
 #
-#  http://www.apache.org/licenses/LICENSE-2.0
+#   http://www.apache.org/licenses/LICENSE-2.0
 #
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied. See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 export EnableNuGetPackageRestore=true
 wget http://nuget.org/nuget.exe
 mv nuget.exe ./DotNet/ServerResource/.nuget/NuGet.exe
diff --git a/plugins/hypervisors/ovm3/src/test/resources/scripts/socat.sh 
b/plugins/hypervisors/ovm3/src/test/resources/scripts/socat.sh
index e37ba47cfa9..6072bb64644 100755
--- a/plugins/hypervisors/ovm3/src/test/resources/scripts/socat.sh
+++ b/plugins/hypervisors/ovm3/src/test/resources/scripts/socat.sh
@@ -1,19 +1,21 @@
-#Licensed to the Apache Software Foundation (ASF) under one
-#or more contributor license agreements.  See the NOTICE file
-#distributed with this work for additional information
-#regarding copyright ownership.  The ASF licenses this file
-#to you under the Apache License, Version 2.0 (the
-#"License"); you may not use this file except in compliance
-#with the License.  You may obtain a copy of the License at
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
 #
-#  http://www.apache.org/licenses/LICENSE-2.0
+#   http://www.apache.org/licenses/LICENSE-2.0
 #
-#Unless required by applicable law or agreed to in writing,
-#software distributed under the License is distributed on an
-#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#KIND, either express or implied.  See the License for the
-#specific language governing permissions and limitations
-#under the License.
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
 
 CERT="/etc/ovs-agent/cert"
 socat 
OPENSSL-LISTEN:8899,reuseaddr,fork,verify=0,key=$CERT/key.pem,cert=$CERT/certificate.pem
 TCP:localhost:8898 &
diff --git a/plugins/hypervisors/ovm3/src/test/resources/scripts/tail.sh 
b/plugins/hypervisors/ovm3/src/test/resources/scripts/tail.sh
index 2665c44e143..458f3ec74ba 100755
--- a/plugins/hypervisors/ovm3/src/test/resources/scripts/tail.sh
+++ b/plugins/hypervisors/ovm3/src/test/resources/scripts/tail.sh
@@ -1,19 +1,21 @@
-#Licensed to the Apache Software Foundation (ASF) under one
-#or more contributor license agreements.  See the NOTICE file
-#distributed with this work for additional information
-#regarding copyright ownership.  The ASF licenses this file
-#to you under the Apache License, Version 2.0 (the
-#"License"); you may not use this file except in compliance
-#with the License.  You may obtain a copy of the License at
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
 #
-#  http://www.apache.org/licenses/LICENSE-2.0
+#   http://www.apache.org/licenses/LICENSE-2.0
 #
-#Unless required by applicable law or agreed to in writing,
-#software distributed under the License is distributed on an
-#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#KIND, either express or implied.  See the License for the
-#specific language governing permissions and limitations
-#under the License.
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
 
 cd /var/log
 tail -f ovm-consoled.log devmon.log messages ovs-agent.log ovmwatch.log
diff --git a/scripts/vm/hypervisor/kvm/nasbackup.sh 
b/scripts/vm/hypervisor/kvm/nasbackup.sh
index e298006f7a8..7f4a4b62192 100755
--- a/scripts/vm/hypervisor/kvm/nasbackup.sh
+++ b/scripts/vm/hypervisor/kvm/nasbackup.sh
@@ -1,20 +1,21 @@
 #!/usr/bin/bash
-## Licensed to the Apache Software Foundation (ASF) under one
-## or more contributor license agreements.  See the NOTICE file
-## distributed with this work for additional information
-## regarding copyright ownership.  The ASF licenses this file
-## to you under the Apache License, Version 2.0 (the
-## "License"); you may not use this file except in compliance
-## with the License.  You may obtain a copy of the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing,
-## software distributed under the License is distributed on an
-## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-## KIND, either express or implied.  See the License for the
-## specific language governing permissions and limitations
-## under the License.
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
 
 set -eo pipefail
 
diff --git a/scripts/vm/hypervisor/kvm/nsrkvmbackup.sh 
b/scripts/vm/hypervisor/kvm/nsrkvmbackup.sh
index 2fcfa0b6424..15ed6343192 100755
--- a/scripts/vm/hypervisor/kvm/nsrkvmbackup.sh
+++ b/scripts/vm/hypervisor/kvm/nsrkvmbackup.sh
@@ -1,20 +1,21 @@
 #!/bin/bash
-## Licensed to the Apache Software Foundation (ASF) under one
-## or more contributor license agreements.  See the NOTICE file
-## distributed with this work for additional information
-## regarding copyright ownership.  The ASF licenses this file
-## to you under the Apache License, Version 2.0 (the
-## "License"); you may not use this file except in compliance
-## with the License.  You may obtain a copy of the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing,
-## software distributed under the License is distributed on an
-## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-## KIND, either express or implied.  See the License for the
-## specific language governing permissions and limitations
-## under the License.
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
 
 version=0.9.1
 OPTIND=1
diff --git a/scripts/vm/hypervisor/kvm/nsrkvmrestore.sh 
b/scripts/vm/hypervisor/kvm/nsrkvmrestore.sh
index 40a9021e850..0a6f5f98b94 100755
--- a/scripts/vm/hypervisor/kvm/nsrkvmrestore.sh
+++ b/scripts/vm/hypervisor/kvm/nsrkvmrestore.sh
@@ -1,20 +1,21 @@
 #!/bin/bash
-## Licensed to the Apache Software Foundation (ASF) under one
-## or more contributor license agreements.  See the NOTICE file
-## distributed with this work for additional information
-## regarding copyright ownership.  The ASF licenses this file
-## to you under the Apache License, Version 2.0 (the
-## "License"); you may not use this file except in compliance
-## with the License.  You may obtain a copy of the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing,
-## software distributed under the License is distributed on an
-## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-## KIND, either express or implied.  See the License for the
-## specific language governing permissions and limitations
-## under the License.
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
 
 version=0.9.1
 OPTIND=1
diff --git a/systemvm/debian/opt/cloud/bin/baremetal_snat.sh 
b/systemvm/debian/opt/cloud/bin/baremetal_snat.sh
index 2092ded4e4e..5952eec39c6 100755
--- a/systemvm/debian/opt/cloud/bin/baremetal_snat.sh
+++ b/systemvm/debian/opt/cloud/bin/baremetal_snat.sh
@@ -1,21 +1,21 @@
 #!/bin/bash
 
-#Licensed to the Apache Software Foundation (ASF) under one
-#or more contributor license agreements.  See the NOTICE file
-#distributed with this work for additional information
-#regarding copyright ownership.  The ASF licenses this file
-#to you under the Apache License, Version 2.0 (the
-#"License"); you may not use this file except in compliance
-#with the License.  You may obtain a copy of the License at
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
 #
-#  http://www.apache.org/licenses/LICENSE-2.0
+#   http://www.apache.org/licenses/LICENSE-2.0
 #
-#Unless required by applicable law or agreed to in writing,
-#software distributed under the License is distributed on an
-#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#KIND, either express or implied.  See the License for the
-#specific language governing permissions and limitations
-#under the License.
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
 
 set +u
 
diff --git a/systemvm/debian/opt/cloud/bin/dnsmasq.sh 
b/systemvm/debian/opt/cloud/bin/dnsmasq.sh
index d675e08c75b..8cba9c533c5 100755
--- a/systemvm/debian/opt/cloud/bin/dnsmasq.sh
+++ b/systemvm/debian/opt/cloud/bin/dnsmasq.sh
@@ -1,4 +1,5 @@
 #!/usr/bin/env bash
+
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -10,6 +11,7 @@
 #   http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
diff --git a/systemvm/debian/opt/cloud/bin/prepare_pxe.sh 
b/systemvm/debian/opt/cloud/bin/prepare_pxe.sh
index 9c4c18eda7b..6da309bb1e5 100755
--- a/systemvm/debian/opt/cloud/bin/prepare_pxe.sh
+++ b/systemvm/debian/opt/cloud/bin/prepare_pxe.sh
@@ -1,9 +1,9 @@
 #!/bin/sh
-#
+
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
-# # regarding copyright ownership.  The ASF licenses this file
+# regarding copyright ownership.  The ASF licenses this file
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
@@ -16,7 +16,6 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-#
 
 set +u
 
diff --git a/tools/devcloud4/common/configure-network.sh 
b/tools/devcloud4/common/configure-network.sh
index bcab6602d92..06d67d80b7e 100755
--- a/tools/devcloud4/common/configure-network.sh
+++ b/tools/devcloud4/common/configure-network.sh
@@ -1,23 +1,23 @@
 #!/bin/bash
-# Usage ./reset-network.sh interface ip netmask
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
 #
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
+#   http://www.apache.org/licenses/LICENSE-2.0
 #
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Usage ./reset-network.sh interface ip netmask
 
 [ $# -lt 3 ] && { echo -e "Missing arguments\nUsage: ./reset-network interface 
ip netmask label"; exit 1; }
 

Reply via email to