GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove sudo command in scripts · chrishantha/install-java@e9f5b23

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • install-java.sh
  • uninstall-java.sh
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎install-java.sh‎

Copy file name to clipboardExpand all lines: install-java.sh
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fi
7474

7575
#Check whether unzip command exsits
7676
if ! command -v unzip >/dev/null 2>&1; then
77-
echo "Please install unzip (sudo apt -y install unzip)"
77+
echo "Please install unzip (apt -y install unzip)"
7878
exit 1
7979
fi
8080

@@ -170,15 +170,15 @@ if (confirm "Run update-alternatives commands?"); then
170170
do
171171
command_path=$extracted_dirname/bin/$i
172172
if [[ -f $command_path ]]; then
173-
sudo update-alternatives --install "/usr/bin/$i" "$i" "$command_path" 10000
174-
sudo update-alternatives --set "$i" "$command_path"
173+
update-alternatives --install "/usr/bin/$i" "$i" "$command_path" 10000
174+
update-alternatives --set "$i" "$command_path"
175175
fi
176176
done
177177

178178
lib_path=$extracted_dirname/jre/lib/amd64/libnpjp2.so
179179
if [[ -d "/usr/lib/mozilla/plugins/" && -d $lib_path ]]; then
180-
sudo update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "$lib_path" 10000
181-
sudo update-alternatives --set "mozilla-javaplugin.so" "$lib_path"
180+
update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "$lib_path" 10000
181+
update-alternatives --set "mozilla-javaplugin.so" "$lib_path"
182182
fi
183183
fi
184184

Collapse file

‎uninstall-java.sh‎

Copy file name to clipboardExpand all lines: uninstall-java.sh
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,15 @@ if (confirm "Run update-alternatives commands?"); then
7676

7777
for i in "${commands[@]}"
7878
do
79-
sudo update-alternatives --remove "$i" "$java_dist_dir/bin/$i"
79+
update-alternatives --remove "$i" "$java_dist_dir/bin/$i"
8080
done
8181

8282
if [[ -d "/usr/lib/mozilla/plugins/" ]]; then
83-
sudo update-alternatives --remove "mozilla-javaplugin.so" "$java_dist_dir/jre/lib/amd64/libnpjp2.so"
83+
update-alternatives --remove "mozilla-javaplugin.so" "$java_dist_dir/jre/lib/amd64/libnpjp2.so"
8484
fi
8585
fi
8686

8787
if (confirm "Remove directory '$java_dist_dir'?"); then
8888
rm -rf $java_dist_dir
89-
fi
89+
fi
90+

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.