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
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: install-java.sh +5-5Lines changed: 5 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
74 | 74 |
|
75 | 75 | #Check whether unzip command exsits |
76 | 76 | 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)" |
78 | 78 | exit 1 |
79 | 79 | fi |
80 | 80 |
|
@@ -170,15 +170,15 @@ if (confirm "Run update-alternatives commands?"); then |
170 | 170 | do |
171 | 171 | command_path=$extracted_dirname/bin/$i |
172 | 172 | 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" |
175 | 175 | fi |
176 | 176 | done |
177 | 177 |
|
178 | 178 | lib_path=$extracted_dirname/jre/lib/amd64/libnpjp2.so |
179 | 179 | 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" |
182 | 182 | fi |
183 | 183 | fi |
184 | 184 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: uninstall-java.sh +4-3Lines changed: 4 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -76,14 +76,15 @@ if (confirm "Run update-alternatives commands?"); then |
76 | 76 |
|
77 | 77 | for i in "${commands[@]}" |
78 | 78 | do |
79 | | - sudo update-alternatives --remove "$i" "$java_dist_dir/bin/$i" |
| 79 | + update-alternatives --remove "$i" "$java_dist_dir/bin/$i" |
80 | 80 | done |
81 | 81 |
|
82 | 82 | 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" |
84 | 84 | fi |
85 | 85 | fi |
86 | 86 |
|
87 | 87 | if (confirm "Remove directory '$java_dist_dir'?"); then |
88 | 88 | rm -rf $java_dist_dir |
89 | | -fi |
| 89 | +fi |
| 90 | + |